0

I'm trying to authenticate using an identity provider that has its token endpoint on /profile/oidc/token instead of the usual /oauth/token endpoint. Is there any way to customize this? I'm always getting an error when exchanging the code for an access token.

1
  • Something like this? services.AddAuthentication(options => { options.DefaultChallengeScheme = "CustomProvider"; }).AddOAuth("CustomProvider", options => { options.ClientId = Configuration["ClientId"]; options.ClientSecret = Configuration["ClientSecret"]; options.AuthorizationEndpoint = "<your custom authorization endpoint>"; options.TokenEndpoint = "<your custom token endpoint>"; }); Commented Mar 13 at 14:08

1 Answer 1

0

You can override some of the URL's in AddOpenIDConnect by adding your own custom event handlers.

For example:

AddOpenIdConnect(options =>
{
   ...
   options.Events.OnRedirectToIdentityProviderForSignOut = context =>
   {
       context.ProtocolMessage.IssuerAddress =
                                "https://localhost:7001/connect/endsession";
       return Task.CompletedTask;
   };
});

I did explain this in a bit more detail in a blog post about: IdentityServer In Docker Containers (part 4/4)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.