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.
NOTE: Passage Social Authentication is currently not available for tvOS or watchOS.
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:
NOTE: Passage does not currently support non-Apple providers on macOS or visionOS.
Authorize Social Connection
To register or log in a user using a Social Connection, simply call passage.social.authorize(connection)
. Here is an example using sign in with Apple:
do {
try await passage.social.authorize(connection: .apple)
// Do authenticated stuff
} catch {
// Handle error
}
Sign in with Apple UX
When using sign in with Apple, the OS 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.