Hi @SandeepG ,
Thanks for reaching out.
The AddMicrosoftIdentityWebAppAuthentication
method in the Microsoft identity platform API allow developers to add code for advanced authentication scenarios.
prompt=select_account
parameter will force the user to select the account they want to use even if they are already signed in with a Google account.
To add this parameter in your URL, you need to modify the OpenIdConnectOptions
in your Startup.cs
file.
services.Configure<OpenIdConnectOptions>(options =>
{
options.Events.OnRedirectToIdentityProvider = context =>
{
context.ProtocolMessage.SetParameter("prompt", "select_account");
return Task.FromResult(0);
};
});
This code adds an event handler for the OnRedirectToIdentityProvider
event, which is triggered when the user needs to be redirected to the Google Account.
For logout, you can clear authentication cookies from the current session and delete the current user's tokens from the token store by sending a GET request to the https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/logout endpoint.
and to change the post-sign-out-redirect page by adding /logout?post_logout_redirect_uri=/index.html
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.