I'm using node-oidc-provider v6 and missing offline_access scope in authorization response. I found in the library code that offline_access can be automatically removed in some cases. https://github.com/panva/node-oidc-provider/blob/v6.x/lib/actions/authorization/check_scope.js#L55
If I remove this line (line #55) everything works okay. How can I add consent to prompts?
I have endpoint to handle prompt with consent screen.
case 'consent': {
const consent = {
rejectedScopes: [],
rejectedClaims: [],
replace: false,
};
return oidc.interactionFinished(
req,
res,
{ consent },
{
mergeWithLastSubmission: true,
}
);
}
Make sure you're passing
prompt=consentURL param to the initial code request (to the/authendpoint).More info: https://developers.google.com/identity/openid-connect/openid-connect#authenticationuriparameters
I also compared your code to mine and I'm pretty much using code from the Koa example. During the first OAuth request,
consentis just an empty object. See this example for reference