Social Authentication

Authorize and authenticate a user using Social Connections

You can easily add Social Authentication to your app using providers like Apple, Google, or GitHub to authenticate your users. Before moving forward, you'll need to configure your Social Connection in the Passage Console.

iOS Requirements

Sign in with Apple

If you are using Sign in with Apple, you'll need to add the Sign in with Apple "capability" in Xcode.

Non-Apple providers

If you are using a non-Apple provider like Google or GitHub, you'll need to add your Passage app identifier as a "URL Scheme" in your app's Target > Info > URL Types section, prefixed with "passage-" like in the example below:

Authorize Social Connection

To register or log in a user using a Social Connection, simply call passage.authorize(with:in:). Here is an example using Sign in with Apple:

try await passage.authorize(with: .apple, in: view.window)
// If successful, you will be able to get the current user:
let user = try await passage.getCurrentUser()

Sign in with Apple UX

When using Sign in with Apple, iOS will show a native Sign in with Apple prompt where the user can use their device's iTunes account and biometrics to quickly log in.

NOTE: Apple gives the user the option to "hide" their email address when registering, so the email address registered to the user may only be a forwarding address - not their real email.

Non-Apple UX

When using a non-Apple provider, a secure web view will open on top of your app where the user will be prompted to authorize the connection to your app via the provider.

Last updated