-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] AadClientRegistrationRepository#toClientRegistration did not set userInfoUri #31546
Comments
In spring-boot-autoconfigure, userInfoUri will be got from issuerUri |
The
As the java doc of OidcUser says:
So whether to set userInfoUri, it depends, we need to check whether there are different "claims" in OidcUserInfo rather than in the OidcIdToken, and then make a decision whether to set the value by default, or provide an option to user. Also, our AadOAuth2UserService#loadUser doesn't use the oidcUser information returned by OidcUserService#loadUser. |
We need to make a design(decision) what is expected to return in AadOAuth2UserService#loadUser .
|
The javadoc does not match the implementation.
|
I think we have two options:
I prefer to the second option.
What do you think @saragluna ? |
IMO, we should figure out the following questions before making a decision:
|
What's the API (input/output) of an OAuth2UserService#loadUser method@FunctionalInterface
public interface OAuth2UserService<R extends OAuth2UserRequest, U extends OAuth2User> {
U loadUser(R userRequest) throws OAuth2AuthenticationException;
}
What's the difference between the API and our current implementation
What's the difference between the responses from the user info endpoint and what we call from the graph endpoint (our current implementation)?
{
"sub": "OLu859SGc2Sr9ZsqbkG-QbeLgJlb41KcdiPoLYNpSFA",
"name": "Mikah Ollenburg", // all names require the “profile” scope.
"family_name": " Ollenburg",
"given_name": "Mikah",
"picture": "https://graph.microsoft.com/v1.0/me/photo/$value",
"email": "mikoll@contoso.com" // requires the “email” scope.
} SummaryThe picture shows the difference between our Spring Cloud Azure implementaition and Spring security implementaition.
Step1 in detailThis is a sample to show implementaition logic in Spring Cloud Azure. Below is a sample to show the implementaition logic in Spring Security. |
Updates relates to Step2 "Construct UserInfo"
|
Context
In current AadClientRegistrationRepository#toClientRegistration ,
userInfoUri
is not set, which caused OidcUserService#shouldRetrieveUserInfo always returns false.Problem
OidcUserService#shouldRetrieveUserInfo always returns false, it is unexpected behavior.
Goal
Useful links
https://learn.microsoft.com/en-us/azure/active-directory/develop/userinfo
The text was updated successfully, but these errors were encountered: