Reputation: 615
I'm currently running into an OAuth token endpoint failure
using the AspNet.Security.OAuth.Discord
library during login after Discord has authenticated me and returned to my ASP.NET
site. The code for authentication is detailed below, with full error logs and relevant controller, with all this running in a docker container. Any help would be greatly appreciated!
The exact error is AspNet.Security.OAuth.Discord.DiscordAuthenticationHandler[4]: Error from RemoteAuthentication: OAuth token endpoint failure: Status: BadRequest
. This occurs after visiting http://.../login
, which returns to the default /signin-discord
URL of the library, with an expected parameter of code
in /signin-discord?code=....
.
Authentication Scheme when creating WebApplication:
MVC Controller:
Error Logs:
Upvotes: 0
Views: 702
Reputation: 615
Seemingly fixed by putting app.UseAuthentication();
below app.UseRouting();
and above app.UseAuthorization();
and app.UseEndpoints();
Upvotes: 3