nxtbgthng / OAuth2Client

Client library for OAuth2 (currently built against draft 10 of the OAuth2 spec)
855 stars 217 forks source link

OAuth with UiWebView And SSL #198

Closed Sravanik84 closed 8 years ago

Sravanik84 commented 8 years ago

Hi team, I am trying to get access token (get authenticated) using a UIWebView. I am receiving the SSL certificate error immediately after hitting the url.

Code: [[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:kIDMOAuth2AccountType withPreparedAuthorizationURLHandler:^(NSURL *preparedURL){

                                   //navigate to the URL returned by NXOAuth2Client
                                   [self.loginWebView loadRequest:[NSURLRequest requestWithURL:preparedURL]];
                               }];

Error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

I need to authenticate in webview because i need the auth server web session id, for further loading the other urls. I am able to get the access token with user name and password, however I am not able to load the other urls with access token as they need the web session id.

  1. How do I get rid of the error posted above, if I want to be authenticated via UIWebvIew?
  2. If authenticated with user & password, can I get auth server web session id?

Please provide some details in which direction I should move forward. This became a big blocker for my app now.

toto commented 8 years ago

I think you are running into App Transport Security. Take a look at the iOS 9 release notes