I am using the following to get an access token…
getOpenIdMiddleware(){
const verify = (issuer, audience, profile, access_token, refresh_token, cb)=>{
const obj = profile._json;
obj.access = access_token;
return cb(null, obj);
}
const oidcAuth0Config = {
domain: process.env.AUTH0_DOMAIN,
clientID: process.env.CLIENT_ID,
clientSecret: process.env.SECRET,
audience: process.env.AUDIENCE,
callbackURL: process.env.AUTH0_CALLBACK_URL,
};
console.log(oidcAuth0Config);
passport.use(new oidc.Strategy(
oidcAuth0Config,
verify,
));
this.type = "auth0-oidc";
}
But when I try to call the https://<my-domain>.us.auth0.com/api/v2/users/<userid>
with the token in the authorization header I get…
{
"statusCode": 400,
"error": "Bad Request",
"message": "Bad HTTP authentication header format",
"errorCode": "Bearer"
}
I can get it working when I manually grab the token using the /oauth/token
but I need to get the users idp token to request resources.