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

SFSafariViewController not closing when authentication is finished #2

Closed
WillBishop opened this issue May 11, 2017 · 2 comments
Closed

Comments

@WillBishop
Copy link

Hello, I was linked to this library by you on another issue I posted.

My problem at the moment is, I am using a third-party API which uses a Google Auth system. When it finished it redirect to a url along the lines of:

https://ab.cdef.gh.ij.lmno?code=dfim34958yjsisnijq0294tj

In my Info.plist I have the following:

<key>CFBundleURLTypes</key>
	<array>
	  <dict>
	    <key>CFBundleURLSchemes</key>
	      <array>
	        <string>com.googleusercontent.apps.myid</string>
	      </array>
	  </dict>
	</array>

And in the Swift file:

fileprivate static let ClientID = "myid.apps.googleusercontent.com"
fileprivate static let RedirectURI = "https://ab.cdef.gh.ij.lmno" //Having in the form suggested caused an invalid_scheme error (or something like that)

However when auth is finished, is SFSafariViewController supposed to close? If not how would I obtain the code?

Any help is much appreciated, thanks!

@elsesiy
Copy link
Owner

elsesiy commented Jun 5, 2017

@WillBishop SFSafariViewController is not supposed to close but rather sent to the background as you will be redirect back to the redirectURI after successful authentication. So you're trying to authenticate the user on behalf of another service? Usually you'd provide a custom url scheme for your app which then gets opened automatically upon redirect.

@elsesiy
Copy link
Owner

elsesiy commented Jun 16, 2017

Closed due to inactivity.

@elsesiy elsesiy closed this as completed Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants