Authentication
OAuth Google Authorize

OAuth Google Authorize

API Documentation: OAuth Google Authorize

Overview

This API endpoint allows you to login to your Xellar MPC wallet account using google account.

  • HTTP Method: POST
  • Endpoint: /api/v1/auth/google

Request Body Parameters

  • credential (required): Credential token from google login.
  • expireDate (optional): The expiration date for the JWT token generated from the response.

Example Request Body

{
    "credential": "user_credentials",
    "expireDate": "2024-10-02"
}

Request

Request Headers

  • x-client-secret (required): Client secret which was generated when register in Xellar MPC API Service Dashboard.

Example Request Syntax

curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -d '{
    "credential": "'$YOUR_CREDENTIAL'",
    "expireDate": "2024-10-02"
}' https://mpc.xellar.co/api/v1/auth/google

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message providing additional information about the operation.
  • data (object): An object containing the access token (If account do not have an MPC wallet, the key is accessToken. Otherwise the key is walletToken).

Example Response (if account do not have an MPC wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "accessToken": "your_access_token_here",
        "isWalletCreated": false
    }
}

Example Response (if account already have an MPC wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "walletToken": "your_access_token_here",
        "isWalletCreated": true
    }
}