Open Closed

What is expected behaviour for registering via external provider? #9929


User avatar
0
dshapiro created

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:

  1. Redirect to Google consent screen
  2. After approval, redirect back to ABP application's registration page
  3. 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)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • When using ABP Framework's Account Module with an external provider like Google, the expected out-of-the-box behavior is as follows:
      1. The user clicks the "Google" button and is redirected to the Google consent screen.
      2. After authentication and consent, the user is redirected back to the ABP application's registration page.
      3. 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, and profile 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 and name 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:


    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.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you check the Access Token and claims from Google?

    Please set a breakpoint to check the accesstoken and claims .

    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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 23, 2025, 10:47