简体   繁体   English

iOS 和 ADFS 受保护的 web 站点

[英]iOS and ADFS protected web site

I have a web application that is protected using ADFS, this was previously NTLM.我有一个使用 ADFS 保护的 web 应用程序,这以前是 NTLM。 We used to be able to retrieve data using the ASIHTTPRequest classes, but it does not appear to work with ADFS.我们曾经能够使用 ASIHTTPRequest 类检索数据,但它似乎不适用于 ADFS。 The response is a redirect to the login url.响应是对登录 url 的重定向。

Is this the correct method of connecting from iOS to a ADFS protected URL?这是从 iOS 连接到受 ADFS 保护的 URL 的正确方法吗?

    NSURL *url = [NSURL URLWithString:@"https://URL_TO_WCF_SERVICE"];

    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"Basic %@",[ASIHTTPRequest base64forData:[[NSString stringWithFormat:@"%@:%@",userName, password] dataUsingEncoding:NSUTF8StringEncoding]]]];
    [request startSynchronous];
    NSError *error = [request error];
    if (!error) {
        NSString *response = [request responseString];
        NSLog(@"%@", response);
    }

It might be related to Extended Protection.它可能与扩展保护有关。 See NTLM authentication to AD FS for non-IE browser without 'Extended Protection' switched off?请参阅未关闭“扩展保护”的非 IE 浏览器对 AD FS 的 NTLM 身份验证? for more info.了解更多信息。

HTH!

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

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