-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Closed
Copy link
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssembly
Milestone
Description
Describe the bug
Using MSAL (With Azure Active Directory), after a successful login (when calling AuthenticationService.RequestAccessToken, the method tokenResult.TryGetToken(out var token) returns a null token value.
To Reproduce
Just generate a new MSAL project using:
dotnet new blazorwasm -au SingleOrg --client-id "{CLIENT ID}" --tenant-id "{TENANT ID}"
And to reproduce, consider the following code in index.razor
@code {
protected override async Task OnInitializedAsync()
{
var tokenResult = await AuthenticationService.RequestAccessToken();
if (tokenResult.TryGetToken(out var token))
{
if (token == null)
throw new Exception("Access token is null. BUG?");
}
}
}token shouldnt be null, since was successfully authenticated.
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssembly