How to Retrieve MS Graph User email and pass extra parameters to callback redirect URL? (Auth, Login with Microsoft button)
@timayabi2020 ci sta già lavorando.
Dal 8/8/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Sorry, I am very dumb, I've searched around, and couldn't find how to do the most basic stuff with the latest v2 of SDK.
I need to add the "Login with Microsoft" button to my app, like I have with Google.
I have created an App and have all the tenant IDs and redirect URL.
Two methods have to be implemented:
- Generate a redirect URL from my app to Microsoft login/consent page
- Callback function where I retrieve the user's email and handle authentication in the app, not related to Microsoft, I don't need to store any access keys, etc.
I need something like:
public function redirectToMicrosoft(Request $request) {
$tenant = ...
$clientId = ...
$clientSecret = ...
$callbackUrl = ...
$scopes = ['User.Read']
$extra_params = ['stuff' => 'something']
// What do I need here to generate the URL from my tenant and other secrets?
$url = $microsoft->getAuthURL($tenant etc, $extra_params)
redirect($url)
public function handleMicrosoftCallback(Request $request) {
// What do I need here to retrieve the user's name/email and extra_params?
$ms_user = $microsoft->user();
$extra_params = $microsoft->getState();
$name = $ms_user->getName();
$email = $ms_user->getEmail();
- Lingua principale
- PHP
- Stelle
- 669
- Fork
- 149
- Merge medio
- 1g 4h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-php
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 commenti ·
-
bug: metadata type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 commenti ·
-
status:waiting-for-triage type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 commenti · 4 reazioni ·
-
status:waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-php#1800 · 3 reazioni ·
-
NowAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
Tutte le issue di microsoftgraph/msgraph-sdk-php
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
matomo-org/plugin-CustomAlerts#310 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Status: Needs Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
php/web-php#2102 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
domain/checkout Platform(Default) priority/low testing/acceptance
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pluginsGLPI/addressing#132 ·
-
5.14.0 PIE packages still declare PHP >=8.3, so PIE installs them on PHP 8.3 and the build failsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100