Class AADOAuth2UserService

  • All Implemented Interfaces:
    org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,​org.springframework.security.oauth2.core.oidc.user.OidcUser>

    public class AADOAuth2UserService
    extends Object
    implements org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,​org.springframework.security.oauth2.core.oidc.user.OidcUser>
    This implementation will retrieve group info of user from Microsoft Graph. Then map group to GrantedAuthority.
    • Method Detail

      • loadUser

        public org.springframework.security.oauth2.core.oidc.user.OidcUser loadUser​(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest)
                                                                             throws org.springframework.security.oauth2.core.OAuth2AuthenticationException
        Specified by:
        loadUser in interface org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,​org.springframework.security.oauth2.core.oidc.user.OidcUser>
        Throws:
        org.springframework.security.oauth2.core.OAuth2AuthenticationException