ProjectLibertyLabs/gateway

Process Authorization Code and Retrieve SiwaPayloadResponse in Gateway

p5150j opened this issue · 0 comments

Process Authorization Code and Retrieve SiwaPayloadResponse in Gateway

Summary:

As a developer, I want the Gateway to process the authorizationCode by exchanging it with Frequency Access for a SiwaPayloadResponse, so that we can authenticate the user and obtain their credentials.

Acceptance Criteria:

  • Implement logic in the Gateway to accept the authorizationCode from the app backend.
  • Gateway sends a GET request to /siwa/api/payload endpoint in Frequency Access to trade the authorizationCode for the SiwaPayloadResponse.
  • Handle the response from Frequency Access, which includes the signed payload and credentials.
  • Process the SiwaPayloadResponse to extract necessary user information.

Tasks:

  1. Implement the processAuthorizationCode() method in the Gateway.
  2. Send a GET request to Frequency Access with the authorizationCode.
  3. Handle the response, parse the SiwaPayloadResponse.
  4. Validate the signed payload and extract user credentials.
  5. Ensure proper error handling for cases where the authorizationCode is invalid or expired.
  6. Write unit tests for the method.