Uploaded image for project: 'mod-users-bl'
  1. mod-users-bl
  2. MODUSERBL-51

Implement endpoint for create/reset password link validation

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 4.3.1
    • EPAM-Veg Sprint 3, EPAM-Veg Sprint 4
    • 5
    • Vega

    Description

      Introduction
      The purpose of this ticket is to provide API and implementation to validate create/reset password link and log user into system to change password.
      In scope of this task a new endpoint have to be created in mod-users-bl to provide this functionality.

      Rest API:

      Reqest:
      POST /bl-users/password-reset/validate
      x-okapi-token: <jwtTokenFromLink>
      Response:

      {
        "resetPasswordActionId": "<resetPasswordActionId>",
        "token": "<accessToken>"
      }
      

      Implementation steps:
      1. Retrieve reset password action id from access token payload ("passwordResetActionId" field)
      2. Get action record by id: GET /authn/password-reset-action/<actionId> (see MODLOGIN-99)
      3. Validate action's expiration time.
      4. Get user by id from mod-users
      5. Sign new system JWT token in mod-authtoken

      POST /token
      {
          "payload": {
              "sub": "<username>",
              "user_id": "<userId>"
          }
      }
      

      6. Return token in response

      Acceptance Criteria

      • new endpoint is implemented;
      • the functionality is covered with tests;
      • module build passes successfully;
      • endpoint is opened to the OKAPI;
      • the API in accessible on testing environment.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                kgambrell Khalilah Gambrell
                Tur Dmytro Tur
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases