{"action":"created","issue":{"url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/232","repository_url":"https://api.github.com/repos/openid/AppAuth-iOS","labels_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/232/comments","events_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/232/events","html_url":"https://github.com/openid/AppAuth-iOS/issues/232","id":317540597,"number":232,"title":"Custom scheme redirect iOS 11","user":{"login":"MarcoTSS2018","id":35953069,"avatar_url":"https://avatars0.githubusercontent.com/u/35953069?v=4","gravatar_id":"","url":"https://api.github.com/users/MarcoTSS2018","html_url":"https://github.com/MarcoTSS2018","followers_url":"https://api.github.com/users/MarcoTSS2018/followers","following_url":"https://api.github.com/users/MarcoTSS2018/following{/other_user}","gists_url":"https://api.github.com/users/MarcoTSS2018/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoTSS2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoTSS2018/subscriptions","organizations_url":"https://api.github.com/users/MarcoTSS2018/orgs","repos_url":"https://api.github.com/users/MarcoTSS2018/repos","events_url":"https://api.github.com/users/MarcoTSS2018/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoTSS2018/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-25T09:08:10Z","updated_at":"2018-05-08T13:35:38Z","closed_at":null,"author_association":"NONE","body":"Hi @all \r\nWe are facing the following problem. Our authentication service only accepts a https scheme for the redirect uri. So it is not possible to use a custom scheme for a deep linking into to app. So we have implemented a redirect page with a button, which references to a custom scheme like com.myapp://token=abcd1234. This solution works perfectly  for iOS 10 and below. On iOS 11 where SFAuthenticationSession is used the library closes the web view without calling any callback. The library seems to block the callbacks when the redirect uri scheme doesn't match the custom scheme.\r\n\r\nIs there a way to omit this behavior?"},"comment":{"url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/comments/387404157","html_url":"https://github.com/openid/AppAuth-iOS/issues/232#issuecomment-387404157","issue_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/232","id":387404157,"user":{"login":"StevenEWright","id":484872,"avatar_url":"https://avatars0.githubusercontent.com/u/484872?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenEWright","html_url":"https://github.com/StevenEWright","followers_url":"https://api.github.com/users/StevenEWright/followers","following_url":"https://api.github.com/users/StevenEWright/following{/other_user}","gists_url":"https://api.github.com/users/StevenEWright/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenEWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenEWright/subscriptions","organizations_url":"https://api.github.com/users/StevenEWright/orgs","repos_url":"https://api.github.com/users/StevenEWright/repos","events_url":"https://api.github.com/users/StevenEWright/events{/privacy}","received_events_url":"https://api.github.com/users/StevenEWright/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T13:35:38Z","updated_at":"2018-05-08T13:35:38Z","author_association":"COLLABORATOR","body":"Generally it's pretty clear when AppAuth is supposed to handle a URL.\r\n\r\nThe only reason it's not in this case is because the IdP doesn't support custom schemes, and the implementor is going outside the typical flow to make it work.\r\n\r\nAs a general principle I'd say the common thing should be easy, and the workaround should be possible.\r\n\r\nPersonally, I feel the current implementation makes sense for most people in most situations, and would advocate for leaving it as the default behavior. That said, I certainly think we should make this flow possible as well.\r\n\r\nWhy not a simple refactor like:\r\n\r\n```\r\n- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL {\r\n  // rejects URLs that don't match redirect (these may be completely unrelated to the authorization)\r\n  if (![self shouldHandleURL:URL]) {\r\n    return NO;\r\n  }\r\n  return [self unsafeResumeExternalUserAgentFlowWithURL:URL];\r\n}\r\n\r\n- (BOOL)unsafeResumeExternalUserAgentFlowWithURL:(NSURL *)URL {\r\n  // checks for an invalid state\r\n  ...\r\n```\r\n\r\n... which would allow implementors in cases like this one to call `unsafeResumeExternalUserAgentFlowWithURL:` explicitly if they care to do so?"}}
{"actor":{"display_login":"StevenEWright"}}