openid / openid/AppAuth-iOS

AuthState callback not called

Open
#484 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

I'm having a similar issue as this closed one with LinkedIn. It redirects correctly to my redirect URL but the SFAuthenticationSession completionHandler doesn't get called after login.

LinkedIn OAuth config

Screen Shot 2019-11-21 at 10 40 24

After login, I simply got redirect to https://twitter.com/ricovalcanaia?code=some_code&state=some_state

iPhone XR - iOS 12 2 - AuthState callback not called mov

My redirect URL is https://twitter.com/ricovalcanaia as you can see here

Due to some business logic(and to avoid forking this repo), our case is a little bit different. We're swizzling OIDAuthorizationFlowSessionImplementation.shouldHandleURL method, which should be called by resumeAuthorizationFlowWithURL inside the SFAuthenticationSession completionHandler, but this is not being called at all after the login. That being said, our Info.plist configuration shouldn't matter here since the user never left the app and we just need to intercept the call to decide if we want to handle the URL or not. Important to notice here that the swizzling is not the issue since this is not even getting called yet, the issue here is the completion handler not being called.

Funny thing is that with Google it works ok. One thing our implementation differs from Google to LinkedIn is that [OIDAuthorizationService discoverServiceConfigurationForIssuer:completion:] doesn't work with LinkedIn but works ok with Google.

Here's a testing repo I created to test this issue: https://github.com/hvsw/AppAuth-LinkedInLogin

Note that I'm using pod 'AppAuth', '~> 0.91.0' and have this branch with the latest version and no swizzling. Created this PR to have an easy diff.

Ideas?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the LinkedIn flow in the AppAuth-LinkedInLogin testing repository and compare it with Google. Inspect PrivateConstants.swift, AppAuthSocialSwizzle.m, and the resumeAuthorizationFlowWithURL path involving SFAuthenticationSession's completionHandler. Done means the callback behavior is explained and the affected authentication flow has a verified resolution or documented provider limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.