Could not find details on what is the expected behaviour for ABP.IO out of the box.
We have setup Google as an external provider. In our Google Cloud we've created an OAuth Consent Screen service & client with available scopes:
/auth/userinfo.email /auth/userinfo.profile openid
During our testing of this feature, when we click the "Google" button on the registration/login screen, the user experiences:
- Redirect to Google consent screen
- After approval, redirect back to ABP application's registration page
- Name fields and email address are blank
Should these fields be pre-populated from the external provider or is this not implemented by ABP?
2 Answer(s)
-
0
- When using ABP Framework's Account Module with an external provider like Google, the expected out-of-the-box behavior is as follows:
- The user clicks the "Google" button and is redirected to the Google consent screen.
- After authentication and consent, the user is redirected back to the ABP application's registration page.
- The registration page should have the email and name fields pre-populated with the information received from Google, provided that the necessary scopes (
openid
,email
,profile
) are configured and Google returns these claims.
If the fields are blank, this typically means that the external provider is not returning the expected claims, or the ABP application is not correctly mapping them. Ensure that:
- The Google OAuth client is configured to request the
openid
,email
, andprofile
scopes. - The ABP application is correctly configured to map the external claims to the registration fields.
By default, ABP attempts to map standard claims like
email
andname
from the external provider to the registration form. If this is not happening, you may need to check your provider configuration or customize the claim mapping in your ABP application.Sources:
- ABP Account Module: External Logins
- ABP Community: Azure AD & External Authentication
- ABP Docs: CurrentUser
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
- When using ABP Framework's Account Module with an external provider like Google, the expected out-of-the-box behavior is as follows:
-
0
hi
Can you check the Access Token and claims from Google?
Please set a breakpoint to check the
accesstoken
andclaims
.context.Services.AddAuthentication() .AddGoogle(GoogleDefaults.AuthenticationScheme, options => { options.Events.OnCreatingTicket = ticketContext => { var accesstoken = ticketContext.AccessToken; var claims = ticketContext.Principal?.Claims.ToList(); return Task.CompletedTask; }; // options.ClaimActions.MapJsonKey(AbpClaimTypes.Email, "your_google_email_claim_key"); // options.ClaimActions.MapJsonKey(AbpClaimTypes.UserName, :"your_google_username_claim_key"); // options.ClaimActions.MapJsonKey(AbpClaimTypes.Name, "your_google_username_claim_key"); })
Thanks.