Skip to main content
Version: 1.4.0

Login and authorization

You can let users log in to your service with the user's DOSI account, using the User Account Connect API.

Connection info

Development environmentAPI base URI
Productionhttps://api.dosi.world

Instructions for use

Partner services must follow the next steps to allow DOSI users to log into the services or to get users' profile data.

You need a Gmail account to log into DOSI with your Google account. You can't use a Google Workspace account.

1. Request DOSI user authorization

Send an authorization request to the authorization endpoint (https://members.dosi.world). You must provide the following service information as query parameters.

ParameterDescription
client_idDOSI channel ID received after applying for DOSI SDK
stateRandom string for OAuth Flow verification
modeOAuth Flow mode. Don't change the value from "oauth".
redirect_uriLanding URI after user login
scopeScope for the user profile group. Don't change the value from "basic".
code_challengeCode challenge value in PKCE. Required if the client is a mobile app.
code_challenge_methodMethod to generate code_challenge in PKCE. Required if the client is a mobile app. Don't change the value from "S256".

The following is an example of sending an authorization request.

https://members.dosi.world?client_id=17XEvciBbskwvvddn0m_&state=hiubweiriuqukjdsfsdrwe&mode=oauth&redirect_uri=https%3A%2F%2Fprofile.dosi.world%2F

When DOSI receives such a request, it moves to the service integration approval page (login page if the user isn't logged in). When the user approves the request, DOSI issues an authorization code to redirect_uri.

2. Issue access tokens

After Step 1, issue an access token using the authorization code. Use the Issue or refresh an access token endpoint.

3. Get user profiles

After Step 2, get user profiles using the access token. Use the Get extended user profile endpoint.

Issue or refresh an access token

Issues an access token with the authorization code or refreshes an access token with the refresh token.

POST {API base URI}/api/v1/oauth2/token

Path

None

Query

None

Body

Name
TypeDescription
Required
grant_typestring

Request type. Either one of the two:

  • "authorization_code": Request to issue an access token
  • "refresh_token": Request to refresh an access token
codestring

An authorization code for the user who issued the access token. Provide this value only when grant_type is "authorization_code". You can get the authorization code with redirect_uri sent with the DOSI authorization request.

client_idstring

DOSI channel ID received after applying for DOSI SDK

client_secretstring

DOSI channel secret received after applying for DOSI SDK

refresh_tokenstring

A refresh token to refresh the access token. Provide this value only when grant_type is "refresh_token". A refresh token can be obtained when the access token is first issued by this endpoint.

Use the latest refresh token only. Sending an expired refresh token will nullify all access tokens and refresh tokens according to the refresh token protection rules. If an expired refresh token is used, the user needs to be authorized again.

code_verifierstring

A random string generated for self-authorization by the client in PKCE. It must be a random value with high entropy. Refer to the reference.

Required if the client is a mobile app.

Headers
  • Content-Type: application/x-www-form-urlencoded

Request examples

curl -v -X POST "https://api.dosi.world/api/v1/oauth2/token" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=authorization_code' \
-d 'code=b5fd32eacc791df' \
-d 'client_id=12345' \
-d 'client_secret=d6524edacc8742aeedf98f'

Revoke the access token

Revokes the access token and refresh token.

POST {API base URI}/api/v1/oauth2/revoke

Path

None

Query

None

Body

None

Headers
  • Authorization: Bearer <access token>
  • Content-Type: application/json

Request examples

curl -v -X POST "https://api.dosi.world/api/v1/oauth2/revoke" \
--header 'Authorization: Bearer <access token>' \
--header 'Content-Type: application/json'

Get extended user profile

Gets the user's extended profile with the access token.

GET {API base URI}/api/v2/profile/extended

Path

None

Query

None

Body

None

Headers
  • Authorization: Bearer <access token>
  • Content-Type: application/json

Request examples

curl -v -X GET "https://api.dosi.world/api/v2/profile/extended" \
--header 'Authorization: Bearer <access token>' \
--header 'Content-Type: application/json'