I have an angular application that's authenticating users using OpenID, in which I have access to the access_token that should be used to authenticate against other services.
I'm currently using the Authetication Code flow of OAuth/OpenID
I am trying to use that access_token to authenticate users on a .NET Core Web API. Whatever combination of settings I make here doesn't seem to get me any closer to the solution.
Startup.cs
services.AddAuthentication(options =>
{
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
options.Authority = oauthOptions.Authority;
options.ClientId = oauthOptions.ClientId;
options.ClientSecret = oauthOptions.ClientSecret;
options.ResponseType = OpenIdConnectResponseType.Code;
options.UsePkce = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.SaveTokens = true;
oauthOptions.Scopes.ForEach(scope => options.Scope.Add(scope));
});
I appreciate any guidance/link on this.