Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[README] the list of supported authentication schemes is missing #4

Closed
dodikk opened this issue Jul 26, 2018 · 5 comments
Closed

[README] the list of supported authentication schemes is missing #4

dodikk opened this issue Jul 26, 2018 · 5 comments

Comments

@dodikk
Copy link

dodikk commented Jul 26, 2018

According to the demo app, the library supports BASIC authentication scheme.
The "readme" page neither mentions that, nor tells about other schemes support.

What is the state of the listed ones ?

@hborders
Copy link
Collaborator

This library supports all of the authentication schemes NSURLAuthentication supports.

@hborders
Copy link
Collaborator

This has been tested with NTLM and ADFS authentication, (which NSURLAuthentication natively supports). Basically, if an authentication method works in Safari, it'll probably work here, too.

@dodikk dodikk closed this as completed Jul 27, 2018
@dodikk
Copy link
Author

dodikk commented Jul 27, 2018

Thanks for the reply. I was asking since I tried to connect via ADFS but failed. My mistake was incorrect stubbing of the canAuthenticateAgainstProtectionSpace: method.

Incorrect code:

- (BOOL)authenticatingHTTPProtocol:(JAHPAuthenticatingHTTPProtocol *)authenticatingHTTPProtocol
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
    // that's not correct
    return true;
}

As the result, I saw some OAuth related redirects in the logs and the desired page has not loaded properly.

Fixed code :

- (BOOL)authenticatingHTTPProtocol:(JAHPAuthenticatingHTTPProtocol *)authenticatingHTTPProtocol
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
    NSArray* interceptedAuthMethods =
    @[
      NSURLAuthenticationMethodHTTPBasic
      , NSURLAuthenticationMethodNTLM
    ];
    
    NSSet* interceptedAuthMethodsSet = [NSSet setWithArray: interceptedAuthMethods];
    
    BOOL canAuthenticate =
        [interceptedAuthMethodsSet containsObject: protectionSpace.authenticationMethod];
    
    return canAuthenticate;
}

P.S. I hope that helps if someone runs into similar problems.

@dodikk
Copy link
Author

dodikk commented Jul 27, 2018

@hborders , thank you for fast replies and for sharing this library.

dodikk pushed a commit to dodikk/JiveAuthenticatingHTTPProtocol that referenced this issue Jul 27, 2018
…iption to the readme.

Added some pitfalls I’ve faced to the readme too.
@dodikk
Copy link
Author

dodikk commented Jul 27, 2018

Added some info from this discussion to the readme via #7

dodikk pushed a commit to dodikk/JiveAuthenticatingHTTPProtocol that referenced this issue Jul 30, 2018
…iption to the readme.

Added some pitfalls I’ve faced to the readme too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants