我们正在使用MVC-Owin-OAuth2开发自定义授权服务器并将其与cortana集成 - 但是,我们发现auth令牌 - 代码授权在通过cortana通道时不会触发

在调查时,我们发现它跳过OWIN授权配置没有从cortana Channels 命中

app.UseOAuthAuthorizationServer(new OAuthAuthorizationServerOptions
        {
            AuthorizeEndpointPath = new PathString(Paths.AuthorizePath),
            TokenEndpointPath = new PathString(Paths.TokenPath),
            ApplicationCanDisplayErrors = true,
            #if DEBUG
            AllowInsecureHttp = true,
            #endif
            // Authorization server provider which controls the lifecycle of Authorization Server
            Provider = new OAuthAuthorizationServerProvider
            {
                OnValidateClientRedirectUri = ValidateClientRedirectUri,
                OnValidateClientAuthentication = ValidateClientAuthentication,
                OnGrantResourceOwnerCredentials = GrantResourceOwnerCredentials,
                OnGrantClientCredentials = GrantClientCredetails
            },

            // Authorization code provider which creates and receives authorization code
            AuthorizationCodeProvider = new AuthenticationTokenProvider
            {
                OnCreate = CreateAuthenticationCode,
                OnReceive = ReceiveAuthenticationCode,
            },

            // Refresh token provider which creates and receives referesh token
            RefreshTokenProvider = new AuthenticationTokenProvider
            {
                OnCreate = CreateRefreshToken,
                OnReceive = ReceiveRefreshToken,
            }
        });

此外,查询字符串中的State参数将作为空传递 .

从CORTANA Channels 调用时,不会触及以下方法:1 . private Task ValidateClientRedirectUri(OAuthValidateClientRedirectUriContext context)

  • private Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)

  • private Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)

  • private Task GrantClientCredetails(OAuthGrantClientCredentialsContext context)

结果 - 用户在客户端授权服务器中成功通过身份验证,但无法将身份验证令牌传递回cortana通道 .

OWIN中间件或代码中是否有任何限制 . 我不确定 .

请分享你的想法 .

谢谢