-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend / add custom provider #220
Comments
Ops, a bit to fast here. Found this in the docs:
I guess it's just like that... 🕺 I'm planning to build/host my own simple provider with either oidc-provider or Ory Any thoughts, guidelines or recommendations? Thanks! |
I've done it with {
"panva": {
"authorize_url": "http://localhost:4000/auth",
"access_url": "http://localhost:4000/token",
"oauth": 2,
"key": "foo",
"secret": "bar",
"scope": [
"openid"
],
"custom_params": {
"login_hint": "s"
}
}
} var provider = new Provider('http://localhost:4000', {
clients: [
{
client_id: 'foo',
client_secret: 'bar',
redirect_uris: [
'http://localhost:3000/connect/panva/callback'
],
}
],
...
} |
Nice @simov What framework did/do you use (like Express)? Does it work good? "Reliable"? |
I used Express, I think it's ok, but you can go to the |
@simov Can you share the whole working example, please? I've tried follow the one you show above, but can't make it work. I'm not sure about |
@aunsuwijak the rest of the configuration in my case was not relevant to this example. I will try to create a simple working example, but in the meantime, the |
Thanks a lot! 😃 |
Here is a working example: provider.jsvar Provider = require('oidc-provider')
var provider = new Provider('http://localhost:4000', {
clients: [
{
client_id: 'foo',
client_secret: 'bar',
redirect_uris: [
'http://localhost:3000/connect/panva/callback'
]
}
],
})
var server = provider.listen(4000, () => {
console.log('http://localhost:4000/.well-known/openid-configuration')
}) client.jsvar express = require('express')
var session = require('express-session')
var grant = require('grant').express()
express()
.use(session({secret: 'grant', saveUninitialized: true, resave: false}))
.use(grant(require('./config.json')))
.get('/hello', (req, res) => {
res.end(JSON.stringify(req.session.grant.response, null, 2))
})
.listen(3000) config.json{
"panva": {
"authorize_url": "http://localhost:4000/auth",
"access_url": "http://localhost:4000/token",
"oauth": 2,
"key": "foo",
"secret": "bar",
"scope": [
"openid"
],
"custom_params": {
"login_hint": "s"
},
"transport": "session",
"pkce": true,
"redirect_uri": "http://localhost:3000/connect/panva/callback",
"callback": "/hello"
}
} Test
node provider.js
node client.js
|
Hi!
Is there any guide/info on how to add my own custom provider?
BR
The text was updated successfully, but these errors were encountered: