C
C#2y ago
sonodan.

❔ API External OAuth Not Triggering Challenge

Hi all, I have an API endpoint that challenges an external oauth provider scheme to redirect the user to approve access and return an access token. This endpoint works when I call the API endpoint directly. However, when I use a front-end button to trigger an HttpClient call to this endpoint, it hits the endpoint and passes over this statement, but it doesn't redirect to the external identity provider. Any insight why this might be happening? My front-end and backend are on different localhost ports.
[HttpGet]
[Route("login-reddit")]
[AllowAnonymous]
public async Task Login()
{
await HttpContext.ChallengeAsync(
RedditAuthenticationDefaults.AuthenticationScheme, new AuthenticationProperties()
{
RedirectUri = "https://localhost:7109/api/accounts/register"
});
}
[HttpGet]
[Route("login-reddit")]
[AllowAnonymous]
public async Task Login()
{
await HttpContext.ChallengeAsync(
RedditAuthenticationDefaults.AuthenticationScheme, new AuthenticationProperties()
{
RedirectUri = "https://localhost:7109/api/accounts/register"
});
}
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server