DEV Community

Discussion on: Authenticate Next.js SPA with ASP.NET 6 Identity and Duende Identity Server Part 1

Collapse
 
pedrosphericode profile image
Pedro Pereira • Edited

That's a great article, but I couldn't make it work. The WeatherForecast get method would respond with an http 401 even after I complete the authorization process with success (inform client id/secret; been redirected to IS login screen; inform user/password). Also, after updating all NuGet packages, the Swagger UI would not show the "client_secret" field anymore. I've added a RequireClientSecret = false to the client configuration. The authorization process works fine, but I'm still getting an http 401. Would you mind updating this article using the updated version of all NuGet packages within this solution? Thanks.

-- UPDATE
Never mind, I've found what I did wrong.
I was missing an app.UseAuthentication(); right before the app.UseAuthorization();. Also, I have put all the auth config before the default template services. Not sure it makes any difference though.

Collapse
 
slovotverdo profile image
Katsel Sergey

I have been registered there to give you a like - you save my mind from explosion )))