'express-openid-connect how to specify grant type?
I am trying to connect to Openid Issuer and they allow only authorization code and refresh token for my client. I am using express-openid-connect and using the base configuarion to connect to the issuer. It comes back saying implicit grant type is not allowed for this client. How do I specify Authorization code in my request. Please help as I am new to this.
ISSUER_BASE_URL=//issuer URL
CLIENT_ID=//client ID
BASE_URL=http://localhost:3000 //nodejs project base URL
SECRET=<long string>
const express = require('express');
const { auth } = require('express-openid-connect');
require('dotenv').config();
const app = express();
app.use(auth());
app.get('/', (req, res) => {
res.send(`hello ${req.oidc.user.name}`);
//res.send("index")
});
app.get('/callback', (req, res) => {
res.send("logged in");
});
app.set('trust proxy', true);
app.listen(3000, () => console.log('listening at http://localhost:3000'))
Solution 1:[1]
Add the following in app.use to use authorization code:
app.use(
auth({
authorizationParams: {
response_type: 'code',
scope: 'openid profile email'
},
})
);
From https://auth0.github.io/express-openid-connect/interfaces/configparams.html#authorizationparams
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bobbyb |
