How to Authorize a User

how to obtain the details of a user and authorize them

When you use a login flow, the last step which marks the end of a flow is "Authorize User" what this means is that we will send the user to a page which you have marked as your redirect URI.

How to Authenticate a User

  1. AuvoID would redirect the user to the Redirect URI which you have specified in your flow.

  2. After this send a POST request to /api/users/token with your API key specified in the X-API-KEY header, with the token specified in body like this.

{
    "token": "..."
}
  1. This would exchange your token with an accessToken and it would be returned in the response body

  2. You can now use this token to get information about the user by sending a POST request to /api/applications/authenticated-user and get the user information back

{
    "accessToken": "..."
}
  1. This would send you back a response which looks like this

{
    "did": "did:key:1ff3fg...4f34eg"
}

Last updated