Azure-Samples / Azure-Samples/ms-identity-blazor-server
OpenIdConnectAuthenticationHandler: message.State is null or empty
- Dominant language
- C#
- Stars
- 57
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
### Minimal steps to reproduce
Program.cs (Just auth related items)
```
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"));
builder.Services.AddControllersWithViews()
.AddMicrosoftIdentityUI();
builder.Services.AddAuthorization(auth =>
{
// Some assorted simple policies
});
builder.Services.AddServerSideBlazor()
.AddMicrosoftIdentityConsentHandler();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
```
Login.razor
```
Log in
```
Appsettings.json
```
"CallbackPath": "/MicrosoftIdentity/Account/SignIn"
OR
"CallbackPath": "/signin-oidc"
```
### Any log messages given by the failure
> OpenIdConnectAuthenticationHandler: message.State is null or empty
### Expected/desired behavior
Clicking login causes an error page citing the error above. I would expect the Microsoft sign-in page to be presented for normal login flow.
### OS and Version?
> Windows 10
### Versions
> .NET 6.0
### Mention any other details that might be useful
I've tried various alterations to this attempting to force it to work, however I'm unsure as to why the middleware isn't picking up the necessary information. Is this template out of date and needs updated or have I missed something?
Contributor guide
Assessment
This issue has not been assessed yet.