Skip to main content

Social Login

Social Login is a process by which existing login information from a social network services like Facebook, Twitter, or Google, Linkedin, Apple.

Implementation of social login with Bridgekeeper API need few prerequisites from Quintype. Please proceed with implementation once the setup is complete.

API Sequence Diagram

Social Login Web Flow

Social login with OAuth flow (Web)

Below are the steps how we can use social login with Bridgekeeper API's on Web.

  • User initiates a login request with a desired social network provider as login choice such as google, facebook, linkedin etc.

    • A GET call is needed to be made to /api/auth/v1/login with below query params.
      • auth-provider can be any of service providers like Google, Facebook, Linkedin etc and is required.
      • redirect-url redirect-url is used to redirect to the location given post successful login
  • When the user initiates a login request through ouath, service provider collects all the user credentials such as email, password and collects users consent and post successful validation of creds it return back a valid OAuth token which is required for the further and login and session management.

  • On receiving a valid Oauth token from the service provider Bridgekeeper makes an callback call to procure access token and login via a GET call to/api/auth/v1/:provider/callback On successful callback bridgekeeper returns a access token and sets the qt-auth in cookies and logs in the user.

  • Post successful login we can get the user details via GET /api/auth/v1/users/me as qt-auth is set as cookies it return back the user details with a response code of 200 and user is shown as logged in.

Sample CURLs


Refer to Swagger API docs for more info on API usage.

User Details

curl --request GET  'https://<client-domain>/api/auth/v1/users/me'  

Login

curl --request GET 'https://<client-domain>/api/auth/v1/login?auth-provider=google&redirect-url=<redirect-url>'

Provider Callback

curl --request GET 'https://<client-domain>/api/auth/v1/google/callback?state=<state>โ€™

Social login with OAuth flow (Mobile)

Below are the steps on how to integrate Bridgeekeeper API's for Social Login with OAuth flow.

  1. Users initiate a Social Login from mobile app with any one of google, facebook, linkedin, or apple as a choice.

  2. Depending on the user's selected social login choice he is taken to a screen with entire user credentials for authentication purposes.

  3. Post collecting user credentials the social login provider validates the user credentials and user consent and returns back a token to Mobile app for further login process.

  4. Mobile app initiates a login call to Bridgeekeeper with below API POST call should be made to /api/auth/v1/login/:provider with the body as,

    Provider: google, facebook, linkedin, or apple

    {
    "token": "<value received from social network provider>",
    "set-session": true,
    "user": {
    "first-name": "Jack",
    "last-name": "Reacher"
    }
    }

    The token is required here.

  5. Once the login is successful Bridgeekeeper logs in the user and sets the qt-auth in the cookies.

  6. Post successful login we can get the user details and validate the session via GET call to /api/auth/v1/users/me and user is shown as logged in.

API Sequence Diagram

Social login mobile flow

Sample CURL

Login

curl --request POST  'https://<client-domain>/api/login/google' 
--data-raw '{"token": <token>,โ€set-session":true}'