Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Update grant code in mithril database, tokens table, set:

    1. details.used = true

    2. updated_at = now()

  2. Generate ‘access token’ with requested scopes for user_id and client_id based on value of ACCESS_TOKEN_JWT configuration parameter:

  3. Generate ‘refresh token’.

  4. Save tokens that were generated in existing format to mithil database, tokens table, set:

    1. id = token uuid

    2. name = token name (‘access_token’ or ‘refresh_token')

    3. value = hased token

    4. expires_at = date and time when token will be expired in unix-time format

    5. details = additional details of token (scopes, client_id, grant_type, applicant_user_id, applicant_person_id, app_id)

      1. applicant_user_id = value of details.applicant_user_id from grant code (if exists)

      2. applicant_person_id = value of details.applicant_person_id from grant code (if exists)

      3. app_id = uuid of approval between user_id, applicant_user_id and client_id

    6. user_id = id of user

    7. inserted_at = now()

    8. updated_at = now()

  5. Render a response according to specification.