开发者

iOS and ADFS protected web site

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 = [requ开发者_如何学JAVAest 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? for more info.

HTH!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜