Skip to content

feat: add roles claim to Microsoft Provider #1361

Merged
atymic merged 5 commits intoSocialiteProviders:masterfrom
akadoya:master
Jul 6, 2025
Merged

feat: add roles claim to Microsoft Provider #1361
atymic merged 5 commits intoSocialiteProviders:masterfrom
akadoya:master

Conversation

@akadoya
Copy link
Copy Markdown
Contributor

@akadoya akadoya commented May 20, 2025

Adding roles attribute so that the client application can consume it and assign users to roles at login.
(or...exposing id_token itself also works like Okta Provider does, if you'd prefer that way)

Comment thread src/Microsoft/Provider.php
@atymic atymic merged commit 71a2af7 into SocialiteProviders:master Jul 6, 2025
4 checks passed
@SergkeiM
Copy link
Copy Markdown

Hi @atymic @akadoya

Call to undefined method SocialiteProviders\Microsoft\MicrosoftUser::getRoles()

the getRoles method is not part of User class is part of Provider.

To get Roles we need to use the ArrayAccess $user->roles.

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

Successfully merging this pull request may close these issues.

3 participants