所以我现在正在做类似于IdentityServer3 and external login through OpenIDConnect的问题,除了okta作为我的外部Idp . (tl; dr:我有一个本地身份服务器3,通过openid Connect对外部Okta Idp进行身份验证) .
我是OIDC和身份服务器3的新手 . 我的问题还与redirectURL中的内容有关 . 请注意我的本地身份服务器托管在https://localhost:5000/core,在我的启动代码存根中如下
public static void ConfigureIdentityProviders(IAppBuilder app, string signInAsType){
var openIDOptions = new OpenIdConnectAuthenticationOptions
{
AuthenticationType = "oktaOpenID",
Authority = "https://***********.okta.com",
Caption = "Okta Via OpenID",
ClientId = "<client id>",
ClientSecret = "<client secret>",
RedirectUri = "https://localhost:5000/core",
ResponseType = "code",
Scope = "openid email profile",
SignInAsAuthenticationType = signInAsType
}
}
问题在于回调 . 当我对OKTA(我的外部OICD idp)进行身份验证时,它会重定向到https://localhost:5000/core但是浏览器打印
{
Message: "The requested resource does not support http method 'POST'."
}
我有一种感觉,我需要创建一个像https://localhost:5000/core/OIDC的 endpoints
它将接受来自okta的post参数代码和状态,然后将代码传递回okta令牌 endpoints ,但我不知道从哪里开始 .
有帮助吗?我尝试创建一个类似于IdentityServer3 and external login through OpenIDConnect中定义的类,但是因为我没有_1227002的项目,我遇到了构建错误 .
1 回答
好吧,我想通了 . 我不得不通过一个精细齿形梳齿的空间解决方案IdentityServer3 and external login through OpenIDConnect
我做的高级别更改:1)我需要创建一个基于https://github.com/aspnet/AspNetKatana/blob/dev/src/Microsoft.Owin.Security.OpenIdConnect/OpenIdConnectAuthenticationMiddleware.cs的新自定义中间件应用程序,但覆盖AuthenticationHandler方法以使用自定义验证处理程序而不是OpenIdConnectAuthenticationHandler .
2)将两个代码集(ASPNetKatana和SpatialGuys)混合在一起,用细齿梳来修复折旧方法之类的东西 .
3)更改了对getclaims和getToken的调用以使用“/ oauth2 / v1 / userinfo”和“/ oauth2 / v1 / token”而不是“/ userinfo”和“token”,因为okta使用上述 endpoints