ADFS定制身份验证提供程序元数据不匹配

问题描述 投票:1回答:1

我已经为ADFS MFA创建了自定义身份验证器。我已经在元数据中定义了身份验证方法:

 class MyMetadata : IAuthenticationAdapterMetadata
    {
        public virtual string[] AuthenticationMethods
        {
            get { return new[] { 
                "http://schemas.microsoft.com/ws/2012/12/authmethod/otp" }; }
            }
}

还有我的TryEndAuthentication定义为:

   public IAdapterPresentation TryEndAuthentication(IAuthenticationContext context, IProofData proofData, HttpListenerRequest request, out Claim[] claims)
        {
            claims = new Claim[0];
            //return new MyPresentationForm();
            System.Security.Claims.Claim claim = new System.Security.Claims.Claim("http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod", "http://schemas.microsoft.com/ws/2012/12/authmethod/otp");
            claims = new System.Security.Claims.Claim[] { claim };
            return null;

        }

但是我在ADFS日志中收到此错误:

Encountered error during federation passive request. 

Additional Data 

Protocol Name: 
Saml 

Relying Party: 
gitlab-app 

Exception details: 
System.IO.InvalidDataException: The authentication provider returned authentication method http://schemas.microsoft.com/ws/2012/12/authmethod/otp, which is not specified as a supported authentication method in the provider's metadata.
   at Microsoft.IdentityServer.Web.Authentication.External.ExternalAuthenticationHandler.ValidateAdapterClaims(IAuthenticationContext authContext, ICollection`1 claims, Int32 responseLcid)
   at Microsoft.IdentityServer.Web.Authentication.External.ExternalAuthenticationHandler.ProcessAdapterClaims(ICollection`1 claims, AuthenticationContext authContext, ProtocolContext context, IAccountStoreUserData userData)
   at Microsoft.IdentityServer.Web.Authentication.External.ExternalAuthenticationHandler.Process(ProtocolContext context)
   at Microsoft.IdentityServer.Web.Authentication.AuthenticationOptionsHandler.Process(ProtocolContext context)
   at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
c# saml adfs adfs4.0 mfa
1个回答
0
投票

我有同样的问题,您能够解决它吗?

© www.soinside.com 2019 - 2024. All rights reserved.