Open
Description
Was trying to deploy to AWS Lambda (Node.js 20.x) but it fails to exchange the code. It seems like it is required to provide the application/x-www-form-urlencoded
content-type when sending request using axios.
So, changing this one in authn\openid.index.js
:
const postData = qs.stringify(config.TOKEN_REQUEST);
axios.post(discoveryDocument.token_endpoint, postData).then(...)
to this one:
const params = new URLSearchParams();
params.append('grant_type', config.TOKEN_REQUEST.grant_type);
params.append('client_id', config.TOKEN_REQUEST.client_id);
params.append('redirect_uri', config.TOKEN_REQUEST.redirect_uri);
params.append('client_secret', config.TOKEN_REQUEST.client_secret);
params.append('code', config.TOKEN_REQUEST.code);
axios.post(discoveryDocument.token_endpoint, params, { headers: {'content-type': 'application/x-www-form-urlencoded'}}).then(...)
makes it work for me.
Metadata
Metadata
Assignees
Labels
No labels