Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Graph suddenly not returning user profile attributes #207

Open
malle-pietje opened this issue Dec 8, 2023 · 2 comments
Open

Comments

@malle-pietje
Copy link

malle-pietje commented Dec 8, 2023

Hi, we've been using this code in many installations of our software to provide OAuth2.0 login against Azure AD. We are currently on v2.2.1 of this excellent library.

At one site we are suddenly seeing that this code is no longer able to get data from the graph endpoint "/v1.0/me":

   $user            = $provider->get($provider->getRootMicrosoftGraphUri($token) . '/v1.0/me', $token);
   $user_first_name = $user['givenName'] ?? '';
   $user_last_name  = $user['surname'] ?? '';
   $user_full_name  = $user['displayName'] ?? '';
   $user_email      = $user['userPrincipalName'] ?? '';
   $user_profile_id = $user['id'] ?? '';

Either the properties don't exist at the endpoint or they are empty.

Has anyone seen this before and know what the cause can be?

@decomplexity
Copy link

It might be worth establishing whether $user['givenName'], say, is really not set or is empty, since ?? will be true in either case; if false $user_first_name will evaluate as empty anyway.

@hajekj
Copy link
Member

hajekj commented Dec 19, 2023

What does the API response look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants