Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
62 lines (53 loc) · 2.48 KB

File metadata and controls

62 lines (53 loc) · 2.48 KB

Login with Google

HTTP MethodURLRequires Auth
POST/api/v1/loginno

Body Parameters

KeyExample ValueDescription
serviceName*googleThe desired OAuth service name. In this case, google.
accessToken*hashAccess token provided by Google OAuth.
idToken*hashThe ID token provided by Google OAuth.
expiresIn*200Lifetime of token (in seconds).
scopeprofileGoogle scopes for API.

Example Call - As JSON

curl -H "Content-type:application/json" \
      http://localhost:3000/api/v1/login \
      -d '{ 
            "serviceName": "google", 
            "accessToken": "hash",
            "idToken": "hash", 
            "expiresIn": 200, 
            "scope": "profile" }'

Example Response

{
  "status": "success",
  "data": {
      "authToken": "9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq",
      "userId": "aobEdbYhXfu5hkeqG",
      "me": {
          "_id": "aYjNnig8BEAWeQzMh",
          "name": "Rocket Cat",
          "emails": [
              {
                "address": "rocket.cat@rocket.chat",
                "verified": false
              }
          ],
          "status": "offline",
          "statusConnection": "offline",
          "username": "rocket.cat",
          "utcOffset": -3,
          "active": true,
          "roles": [
              "admin"
          ],
          "settings": {
              "preferences": {}
            },
          "avatarUrl": "http://localhost:3000/avatar/test"
      }
   }
}

Change Log

Version Description
1.0.0 Added avatarUrl property to response
0.64.0 Added me property to response
0.60.0 Added