This API allows you to authenticate users and retrieve their profile information within Glob.AI OS.
Refer to the API Reference for details on generic variables needed to use the API.
| Method |
Endpoint |
Description |
| POST |
/oauth/access_token |
Obtain an OAuth 2.0 access token |
| GET |
/openid/userinfo |
Retrieve user profile information |
To access protected resources, you must first obtain an access token using the /oauth/access_token endpoint. Then, include that token in the Authorization header when making the request to the /openid/userinfo endpoint, using the following format:
Authorization: Bearer <access_token>
Obtains an OAuth Access Token for authenticating API requests.
- Method: POST
- Path: $BASE_URL/oauth/access_token
{
"client_id": “string”, // The client identifier.
"scope": “gam_user_data gam_user_roles”, // Space-separated list of requested scopes
"username": “string”, // Username for authentication
"password": “string” // Password for authentication
}
{
"access_token": "string", // The OAuth 2.0 access token
"token_type": "string", // The type of the token, typically "Bearer"
"expires_in": 540000, // Token validity duration, expressed in seconds
"refresh_token": "string", // Token used to obtain a new access token
"scope": "gam_user_data+gam_user_roles", // Scopes granted by the token
"user_guid": "string" // Unique identifier of the authenticated user
}
curl -X POST "$BASE_URL/oauth/access_token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=$client_id" \
-d "scope=gam_user_data gam_user_roles" \
-d "username=$username" \
-d "password=$password"
Retrieves the authenticated user’s profile information, including the sub field that identifies the user uniquely.
Method: GET
Path: $BASE_URL/openid/userinfo
Body: Empty.
{
"sub": "string", // Unique user identifier (subject claim in OpenID)
"guid": "string", // Global unique identifier assigned to the user
"username": "string", // Username used for authentication
"email": "string", // User's email address
"verified_email": true, // Indicates whether the email address has been verified
"first_name": "string", // User's first name
"last_name": "string", // User's last name
"external_id": "string", // External system identifier (if applicable)
"birthday": "string", // User's birth date in YYYY-MM-DD format
"gender": "string", // User's gender (M, F, N, or other supported value)
"url_image": "string", // URL of the user's profile picture
"url_profile": "string", // URL of the user's profile page
"phone": "string", // User's phone number
"address": "string", // User's physical address
"city": "string", // City associated with the user
"state": "string", // State or province associated with the user
"post_code": "string", // Postal or ZIP code of the user's address
"language": "string", // Preferred language (ISO 639-1 code)
"timezone": "string", // User's timezone (IANA format, e.g., "America/Montevideo")
"roles": [ // List of roles assigned to the user
"string"
]
}
curl -X GET "$BASE_URL/openid/userinfo" \
-H "Authorization: Bearer $access_token" \ token obtained in the POST to /oauth/access_token