-
Notifications
You must be signed in to change notification settings - Fork 170
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
OIDC Integration #382
OIDC Integration #382
Conversation
Spell Checker found issuesdoc/parameters.md
Generated by 🚫 Danger |
e92b5dd
to
01aff0b
Compare
859d97c
to
83ec731
Compare
local config = res.headers.content_type == 'application/json' and cjson.decode(res.body) | ||
|
||
if not config then | ||
ngx.log(ngx.STDERR, 'failed to get OIDC Issuer Configuration from ', uri, ' status: ', res.status, ' body: ', res.body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to change the log to ERR
and move this to the TODO a few lines above.
And here log explicitly that that the config couldn't be parsed because the content is not a valid JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3bc2222
return jwt_obj, '[jwt] invalid alg' | ||
end | ||
-- TODO: this should be able to use DER format instead of PEM | ||
local pubkey = format_public_key(self.config.public_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe before formatting first check whether it's already in PEM format? (or maybe the format function itself should do it...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We support only Keycloak and I could not find this in the spec. So looks like this might be keycloak specific.
If you have spec that defines this I'll be happy to validate the input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikz Hm, well, the code doesn't "say" that it's only Keycloak...
So, if we can make it more generic, and potentially make it work for any other IDP (even if not officially supported), that would be just great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find spec for sharing the public key. I don't really have access to other IDPs. And zync supports only Keycloak.
We support only Keycloak initially. The code is made to support other implementations too, but we need spec for them. We don't have spec and don't want to support anything else than Keycloak initially. Once that changes this will change too.
I'm happy to modify this if I'd have at least example / spec of other IDPs.
show the code to add expecation
3bc2222
to
9378081
Compare
and remove RHSSO integration
OIDC integration expects the Client data are already in the IDP.
Then it just uses the OpenID Connect Discovery protocol to get the public key and verify the access token. The application id to report to backend is extracted from the JWT
azp
oraud
field. Once JWT is decoded and verified it is stored in local LRU cache that can fit 10000 entries per worker.APIcast does not communicate with the OpenID Connect Issuer for anything else than to get the certificate view the OpenID Connect Discovery. Clients are synchronised from 3scale to the IDP via http://github.com/3scale/zync.