Blazor WASM security MSAL login mode (#19492)
parent
85667d5100
commit
946c4bd0b4
|
@ -321,6 +321,13 @@ For more information, see the following sections of the *Additional scenarios* a
|
|||
* [Request additional access tokens](xref:blazor/security/webassembly/additional-scenarios#request-additional-access-tokens)
|
||||
* [Attach tokens to outgoing requests](xref:blazor/security/webassembly/additional-scenarios#attach-tokens-to-outgoing-requests)
|
||||
|
||||
::: moniker range=">= aspnetcore-5.0"
|
||||
|
||||
### Login mode
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/msal-login-mode.md)]
|
||||
|
||||
::: moniker-end
|
||||
|
||||
### Imports file
|
||||
|
||||
|
|
|
@ -312,6 +312,13 @@ For more information, see the following sections of the *Additional scenarios* a
|
|||
* [Request additional access tokens](xref:blazor/security/webassembly/additional-scenarios#request-additional-access-tokens)
|
||||
* [Attach tokens to outgoing requests](xref:blazor/security/webassembly/additional-scenarios#attach-tokens-to-outgoing-requests)
|
||||
|
||||
::: moniker range=">= aspnetcore-5.0"
|
||||
|
||||
### Login mode
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/msal-login-mode.md)]
|
||||
|
||||
::: moniker-end
|
||||
|
||||
### Imports file
|
||||
|
||||
|
|
|
@ -151,6 +151,14 @@ For more information, see the following sections of the *Additional scenarios* a
|
|||
* [Request additional access tokens](xref:blazor/security/webassembly/additional-scenarios#request-additional-access-tokens)
|
||||
* [Attach tokens to outgoing requests](xref:blazor/security/webassembly/additional-scenarios#attach-tokens-to-outgoing-requests)
|
||||
|
||||
::: moniker range=">= aspnetcore-5.0"
|
||||
|
||||
## Login mode
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/msal-login-mode.md)]
|
||||
|
||||
::: moniker-end
|
||||
|
||||
## Imports file
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/imports-file-standalone.md)]
|
||||
|
|
|
@ -136,6 +136,14 @@ For more information, see the following sections of the *Additional scenarios* a
|
|||
* [Request additional access tokens](xref:blazor/security/webassembly/additional-scenarios#request-additional-access-tokens)
|
||||
* [Attach tokens to outgoing requests](xref:blazor/security/webassembly/additional-scenarios#attach-tokens-to-outgoing-requests)
|
||||
|
||||
::: moniker range=">= aspnetcore-5.0"
|
||||
|
||||
## Login mode
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/msal-login-mode.md)]
|
||||
|
||||
::: moniker-end
|
||||
|
||||
## Imports file
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/imports-file-standalone.md)]
|
||||
|
|
|
@ -132,6 +132,14 @@ For more information, see the following sections of the *Additional scenarios* a
|
|||
* [Request additional access tokens](xref:blazor/security/webassembly/additional-scenarios#request-additional-access-tokens)
|
||||
* [Attach tokens to outgoing requests](xref:blazor/security/webassembly/additional-scenarios#attach-tokens-to-outgoing-requests)
|
||||
|
||||
::: moniker range=">= aspnetcore-5.0"
|
||||
|
||||
## Login mode
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/msal-login-mode.md)]
|
||||
|
||||
::: moniker-end
|
||||
|
||||
## Imports file
|
||||
|
||||
[!INCLUDE[](~/includes/blazor-security/imports-file-standalone.md)]
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
The framework defaults to pop-up login mode and falls back to redirect login mode if a pop-up can't be opened. Configure MSAL to use redirect login mode by setting the `LoginMode` property of <xref:Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions> to `redirect`:
|
||||
|
||||
```csharp
|
||||
builder.Services.AddMsalAuthentication(options =>
|
||||
{
|
||||
...
|
||||
options.ProviderOptions.LoginMode = "redirect";
|
||||
});
|
||||
```
|
||||
|
||||
The default setting is `popup`, and the string value isn't case sensitive.
|
Loading…
Reference in New Issue