Open Closed

Not properly logging out of External Provider #1619


User avatar
0
KirstyLH created
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Tiered
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue:"

We have a system with both local account and External Provider (Microsoft) login types enabled. When a user logs in to Blazor with a Microsoft account, and then logs out again, if they log in with the same browser then the Microsoft account is assumed and logged in automatically. There is no way to log in with a different Microsoft account without also entering a Microsoft app and logging out. We need the blazor logout to also log the Microsoft account out of the browser.

Is this a configuration issue?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    External Provider (Microsoft)

    Some external provider not supprot Logout eg Microsoft.AspNetCore.Authentication.MicrosoftAccount

    Can you share your provider package and related code?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    KirstyLH created

    We are pretty much just using the built-in logout action. The only change we made was to alter the Microsoft endpoints to support business Microsoft accounts instead of personal ones. Everything seems to work except this less than complete logout.

    private void ConfigureExternalProviders(ServiceConfigurationContext context, IConfiguration configuration)
            {
                context.Services.AddAuthentication()
                    .AddGoogle(GoogleDefaults.AuthenticationScheme, _ => { })
                    .WithDynamicOptions<GoogleOptions, GoogleHandler>(
                        GoogleDefaults.AuthenticationScheme,
                        options =>
                        {
                            options.WithProperty(x => x.ClientId);
                            options.WithProperty(x => x.ClientSecret, isSecret: true);
                        }
                    )
                    .AddMicrosoftAccount(MicrosoftAccountDefaults.AuthenticationScheme, options =>
                    {
                        //Personal Microsoft accounts as an example.
                        var tenantId = configuration["ExternalProviders:Microsoft:TenantId"];
                        options.AuthorizationEndpoint = string.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/authorize", tenantId);
                        options.TokenEndpoint = string.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/token", tenantId);
                    })
                    .WithDynamicOptions<MicrosoftAccountOptions, MicrosoftAccountHandler>(
                        MicrosoftAccountDefaults.AuthenticationScheme,
                        options =>
                        {
                            options.WithProperty(x => x.ClientId);
                            options.WithProperty(x => x.ClientSecret, isSecret: true);
                        }
                    )
                    .AddTwitter(TwitterDefaults.AuthenticationScheme, options => options.RetrieveUserDetails = true)
                    .WithDynamicOptions<TwitterOptions, TwitterHandler>(
                        TwitterDefaults.AuthenticationScheme,
                        options =>
                        {
                            options.WithProperty(x => x.ConsumerKey);
                            options.WithProperty(x => x.ConsumerSecret, isSecret: true);
                        }
                    );
            }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi KirstyLH

    AddMicrosoftAccount does not support Signout

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.