简体   繁体   English

iOS的ADAL是否与ADFS 3.0版兼容?

[英]Is ADAL for iOS compatible with ADFS version 3.0?

I'm using AzureAD Library for Objective-C ( https://github.com/AzureAD/azure-activedirectory-library-for-objc ) to connect to ADFS 3.0 on 2012 R2 using the OAuth 2 Authorization Code grant flow. 我正在使用用于Objective-C的AzureAD库( https://github.com/AzureAD/azure-activedirectory-library-for-objc )使用OAuth 2授权代码授予流连接到2012 R2上的ADFS 3.0。

I'm getting the error: 我收到错误消息:

Error with code: AD_ERROR_DEVELOPER_INVALID_ARGUMENT 
Domain: ADAuthenticationErrorDomain ProtocolCode:(null) 
Details:The argument 'user principal name' is invalid. 
Value:(null). 
Inner error details: Error Domain=ADAuthenticationErrorDomain Code=100 "(null)"

We have an android app that is connecting successfully, so I don't think this is the real error. 我们有一个可以成功连接的android应用,所以我认为这不是真正的错误。

I'm using v2.6.3 of the library on iOS 11.3, both on an iPhone 6 and on the simulator with the same results. 我在iPhone 6和模拟器上都在iOS 11.3上使用库的v2.6.3,结果相同。

I'm reproduced the issue using the SampleSwiftApp included with the repo, with no code changes apart from the configuration. 我使用存储库中随附的SampleSwiftApp重现了该问题,除了配置外没有任何代码更改。

  • Is v2.6.3 compatible with ADFS v3.0 on 2012 R2? v2.6.3与2012 R2上的ADFS v3.0兼容吗?
  • Can I get it to work with a configuration change? 我可以使它与配置更改一起使用吗?

ADFS v3.0 doesn't support authority validation, so I updated the authentication context constructor from: ADFS v3.0不支持权限验证,因此我从以下方式更新了身份验证上下文构造函数:

let authContext = ADAuthenticationContext(authority: AdalAuthority,
                                          error: nil)

to: 至:

let authContext = ADAuthenticationContext(authority: AdalAuthority,
                                          validateAuthority: false,
                                          error: nil)

to get it to work. 使它工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM