Browse Source
Add documentation for switching users during OAuth login with `prompt=select_account`
pull/22420/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
33 additions and
0 deletions
BIN
docs/en/images/account-pro-select-account-parameter.png
BIN
docs/en/images/account-pro-select-account.png
docs/en/modules/account-pro.md
Width:
|
Height:
|
Size: 110 KiB
Width:
|
Height:
|
Size: 467 KiB
@ -104,6 +104,39 @@ If you use `Social / External Logins`, It is automatically called for authentica

### Switching users during OAuth login
If you have an OAuth/Auth Server application using the Account Pro module, you can pass the `prompt=select_account` parameter to force the user to select an account.
Example to pass `prompt=select_account` parameter in OpenIdConnect:
```csharp
.AddAbpOpenIdConnect("oidc", options =>
{
// ...
options.Events = new OpenIdConnectEvents
{
OnRedirectToIdentityProvider = redirectContext =>
{
redirectContext.ProtocolMessage.Prompt = "select_account";
return Task.CompletedTask;
}
};
// ...
});
```

You have three options:
- Continue: The login process will continue with the current account.
- Switch to another account: Will be redirected to the login page to log in with another account.
- Create a new account: Will be redirected to the register page to create a new account.
> The OAuth login process will continue after the user selects one of the options.

## Social / External Logins