ЕСОЗ - публічна документація

Mithril-GovId

Purpose

Document describes which endpoints of id.gov.ua API are integrated into Mithril application.

Exchange authorization code to access token

GET {hostname}/get-access-token

After successful login via id.gov.ua, clients browser redirected to Mithril endpoint with authorization code and state.

The authorization code is exchanged for an access token to obtain information about the user.

Request params:

paramvaluedescription
client_id
environment variableClient ID for accessing id.gov.ua API
client_secret
environment variableClient Secret for accessing id.gov.ua API
grant_type
authorization_codeMethod through which application can gain Access Token. Predefined value
code
value from requestAuthorization code from request param
redirect_uri
nilRedirect URI. Not used

Response:

fielddescription
access_tokenAccess token for obtaining user information
user_idid.gov.ua user ID
token_typeToken type. bearer by default
expires_inAccess token expiration time
refresh_tokenToken for refreshing Access token

Obtain user info

GET {hostname}/get-user-info

Receive user information with Access token by user_id.

Request params:


paramvaluedescription
user_id
136User ID from /get-access-token response
access_token
access-token Access token from /get-access-token response
fields
id, drfocode, givenname, lastname, middlename, phone
Fetched fields. Predefined value


Response:

fielddescription
idid.gov.ua user ID
drfocodeTax ID
givennameFirst name
lastnameLast name
middlenameSecond name
phonePhone



ЕСОЗ - публічна документація