Blazor WASM security MSAL login mode (#19492)

pull/19496/head
Luke Latham 2020-08-13 05:40:32 -05:00 committed by GitHub
parent 85667d5100
commit 946c4bd0b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 0 deletions

View File

@ -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

View 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

View 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)]

View File

@ -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)]

View File

@ -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)]

View File

@ -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.