iOS 和 ADFS 保护的网站

发布于 2024-11-29 05:43:13 字数 708 浏览 3 评论 0原文

我有一个使用 ADFS 保护的 Web 应用程序,以前是 NTLM。我们过去能够使用 ASIHTTPRequest 类检索数据,但它似乎不适用于 ADFS。响应是重定向到登录 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);
    }

I have a web application that is protected using ADFS, this was previously NTLM. We used to be able to retrieve data using the ASIHTTPRequest classes, but it does not appear to work with ADFS. The response is a redirect to the login url.

Is this the correct method of connecting from iOS to a ADFS protected 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);
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风无影 2024-12-06 05:43:13

这可能与扩展保护有关。请参阅 对 AD FS 进行 NTLM 身份验证对于未关闭“扩展保护”的非 IE 浏览器?了解更多信息。

哈!

It might be related to Extended Protection. See NTLM authentication to AD FS for non-IE browser without 'Extended Protection' switched off? for more info.

HTH!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文