Social Authentication
Social Authentication allows your client to authenticate with social providers. The endpoints are pre-built and are easy for you to manage the social authentication flow from your client application. To get your {auth_base_url}
, check it out here - Get started with base url.
Note : Signup and Login authentication methods are handled under this single endpoint. If the user logging with a provider does not exists, then new user is created or else existing user details are returned as response
Step - 1 : Setup Social Connection
To setup and get connection_name
of your preferrred social connection, check it our here - Setup your social connection
CALLBACK URL
Make sure to configure the below given call back URL in the third party service https://authn.zeromagic.cloud/oauth/callback/
Step - 2 : GET Authorisation Page URL
You will need to redirect the user to preferred social provider page to grant access to your application. You can get this authorize url from the below endpoint. On opening the authorize_url
link, it will display a page asking the user to approve or deny access to your application. However, if you provide an invalid config credentials or redirect_uri then the user will instead see an error page.
Example
You can open this authorize_url
from your client applicantion end and it will be prompted to user consent page.
Step - 3 : User Success Response
Client Redirect URI
It is necessary to add your client application in oauth redirect uri under project settings. The success response is appended to your client application redirect uri as query params. To add oauth redirect uri, check it our here - Add OAuth Redirect uri
The output response will be in the format of {client_oauth_redirect_uri}?{success_params}
For example, if your client_oauth_redirect_uri is https://client.zeromagic.cloud/ then success response will be in the format of
Success Response Example
Error Response Example
The error message is also appended to the redirect uri as query params.The error message will be in the format of https://client.zeromagic.cloud/?error=&message=&code=&state=
Support Social Providers
To know about the supported social providers, visit here - Supported Social Providers
Was this page helpful?