admin管理员组文章数量:1390659
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.
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.
Share Improve this question asked Mar 13 at 9:02 BG931cBG931c 1 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>"; }); – SoftwareDveloper Commented Mar 13 at 14:08
1 Answer
Reset to default 0You 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)
本文标签:
版权声明:本文标题:oauth 2.0 - Any way to customize token endpoint when using Microsoft.AspNetCore.Authentication.OpenIdConnect middleware in ASP.N 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744712324a2621202.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论