Configure authentication to Proxy with Okta Token

Hello!

i have a scenario and i want assistance with apigee X

Scenario 1

  • Call okta https://oktaendpoint.com/api/v1/authn with below to get a authentication success or failure

  • Payload type json - Body { “username”: “username@gmail.com”, “password”: “Testpassword4”}

  • Header Authorizatoin SSWS {TOKEN}

  • Header X-Device-Fingerprint {TOKENFORMFA}

Scenario 2

  • If the scenario 1 is success(200), pass the “username” to the proxy URL as variable in json format

Scenario 3

  • if the scenario 1 is failure 401, error our with invalid credentials error

i’m new to apigee and i could play around with Raise-Fault to error our on Scenario 3, but for the scenario 1 and 2 i need some help to confgure the same