I am working on creating API in Node JS, My requirement is write an APIs which authenticate Okta users from backend using /api/v1/authn endpoint which returns session token and using that token I should be able to retrieve authorization code using /authorize endpoint.
My authorize endpoint with details is as below.
oauth2/{authserverid}/v1/authorize?sessionToken={sessiontoken}&code_challenge_method=S256&code_challenge={codechallenge}&client_id={clientid}&response_type=code&redirect_uri={redirecturi}&scope=openid offline_access&state=MyApp
I have written code in Node js and used Axios for http rest api call.
When I call /authn endpoint it works perfect and give me session token. But when I try to get /authorize endpoint it give me html content with saying that Javascript is not enable. Here I am expecteing 302 response and in response.headers.location I would expect auth code.
I have used maxredirects =0 in axios config.
Do I need to do anything else to fix this issue?
2