Social
#
GoogleTo authenticate a user through Google Sign-In, you can call the googleSignIn
mutation:
note
The googleSignIn
mutation both authenticates and registers users. It will throw a Cannot find matching user
error if registration is disabled, and no user with that email exists.
note
If you have Permission Type
set to Multiple Schemas
in your plugin settings, you will have a googleSignIn
mutation for each user group (e.g. googleSignInUser
and googleSignInBusiness
).
#
FacebookTo authenticate a user through Facebook Login, you first need to call the facebookOauthUrl
query:
Next, send the user to the generated URL and they will be asked to authenticate through Facebook. Once they have authenticated, they will be redirected to your Redirect URL with a code
query parameter (e.g. https://yoursite.com/facebook?code=...
).
Finally, once you've grabbed the code
from the URL, you can call the facebookSignIn
mutation:
note
The facebookSignIn
mutation both authenticates and registers users. It will throw a Cannot find matching user
error if registration is disabled, and no user with that email exists.
note
If you have Permission Type
set to Multiple Schemas
in your plugin settings, you will have a facebookSignIn
mutation for each user group (e.g. facebookSignInUser
and facebookSignInBusiness
).
#
TwitterTo authenticate a user through Log in with Twitter, you first need to call the twitterOauthUrl
query:
Next, send the user to the generated URL and they will be asked to authenticate through Twitter. Once they have authenticated, they will be redirected to your Redirect URL with oauthToken
and oauthVerifier
query parameters (e.g. https://yoursite.com/twitter?oauthToken=...&oauthVerifier=...
).
Finally, once you've grabbed oauthToken
and oauthVerifier
from the URL, you can call the twitterSignIn
mutation:
note
The twitterSignIn
mutation both authenticates and registers users. It will throw a Cannot find matching user
error if registration is disabled, and no user with that email exists.
note
If you have Permission Type
set to Multiple Schemas
in your plugin settings, you will have a twitterSignIn
mutation for each user group (e.g. twitterSignInUser
and twitterSignInBusiness
).
#
AppleTo authenticate a user through Sign in with Apple, you first need to call the appleOauthUrl
query:
Next, send the user to the generated URL and they will be asked to authenticate through Apple. Once they have authenticated, they will be redirected to your Redirect URL with code
and state
POST parameters.
Due to Apple sending the fields as POST parameters, you'll need to add an intermediary route that grabs them (e.g. a Next.js API route), and redirects to your front-end.
Finally, once you've grabbed code
and state
, you can call the appleSignIn
mutation:
note
The appleSignIn
mutation both authenticates and registers users. It will throw a Cannot find matching user
error if registration is disabled, and no user with that email exists.
note
If you have Permission Type
set to Multiple Schemas
in your plugin settings, you will have a appleSignIn
mutation for each user group (e.g. appleSignInUser
and appleSignInBusiness
).