Document how to integrate with ORY / Hydra #706
Replies: 15 comments
-
I documented my trial and error here: https://github.com/isodude/step-ca-oidc-hydra, it's not working at all right now. |
Beta Was this translation helpful? Give feedback.
-
So I had a bug where I sent openid=on instead of grant_scope=openid to consent. A bit embarrassing. |
Beta Was this translation helpful? Give feedback.
-
The error makes it sound like the identity token being returned from Hyrda is not a properly formatted JWT (a JWT is a subtype of JWS). The general format of a JWS is The error makes it sound like the payload portion is missing from the JWS. My best guess is that the token you're getting back is actually an OAuth access token rather than an OpenID Connect (OIDC) identity token. I'm not sure how / why that might be happening, but if you have an example token you could share we can confirm whether or not that's what's happening, which should at least help narrow down what's going wrong. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I've tried a couple of options here, like --oidc etc, no go though. Here's the log and token
|
Beta Was this translation helpful? Give feedback.
-
You are correct there is no mention of oauth2 in acr
|
Beta Was this translation helpful? Give feedback.
-
I added
To the consent app and now there's more info at least. Seems that the consent app is not getting it's ACR value.
|
Beta Was this translation helpful? Give feedback.
-
Ok so, I tried to generate a certificate via ca certificate again, now with --net host on dockers etc.
So all good, I've documented in the run.sh-script how the setup works and in the auth.sh-script how the auth-flow works. |
Beta Was this translation helpful? Give feedback.
-
@isodude That's great! Is this issue "resolved"? Should we turn it into a discussion? Should we convert this to actual documentation? https://github.com/smallstep/docs? @tashian @devadvocado |
Beta Was this translation helpful? Give feedback.
-
If it's resolved, I think we should turn it into a discussion for posterity. @dopey @devadvocado |
Beta Was this translation helpful? Give feedback.
-
My only question was -- is there more here than just a discussion? Like a tutorial or something. But I think a discussion is a good start. Let's see if we keep having to point people to it or if people find it organically and are able to resolve their own issue. |
Beta Was this translation helpful? Give feedback.
-
I think the most headache is around using localhost in everything. For that to work I need to sign a certificate for a local node such that the redirect uri is a https, also I think I will run into trouble with step-ca ca certificate and the fact that it chooses a port at random I think? But yeah, as I have a working example (yay!) we can turn this into a discussion and archive it, and start a MR for a proper documentation instead. The run.sh-script and the auth.sh-script is the actual document here where the whole flow is written down. It is also does not need any user input at all so it can be used as a test :-) |
Beta Was this translation helpful? Give feedback.
-
One thing I don't get is that.. When I run step ca certificate I use the provisioner given to me by the CA, which contains clientId and clientSecret. Isn't the provisioner supposed to be a secret between step-ca and hydra? |
Beta Was this translation helpful? Give feedback.
-
Hey @isodude, The redirect to For tons more details, we follow OAuth Best Current Practices for Native Apps, documented in BCP212 / RFC8252 at https://www.rfc-editor.org/rfc/rfc8252.txt. Because this is a somewhat unique flow, some OAuth IdPs have issues handling it. Even the big ones like Okta and Azure AD have problems (e.g., only support If there is anything specific in the Ory / Hydra world that needs to be done (e.g., it sounds like we need a fixed port specified?) that's worth documenting somewhere (a Github discussion is probably sufficient for now). Regarding the client secret... yes, typically it's meant to be kept secret. But this is not possible, and not required, for "public clients" used by "native apps". Some IdPs explicitly support "public clients" that don't even have a secret, just a client id. The BCP / RFC linked above has all the details. If it makes you feel any better, this is the same pattern that the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the thorough answer. Yeah, being able to specify a local port would be ideal. However it seems that hydra accepts the local port if http://127.0.0.1 is specified as redirect_uri/callbacks. It's quite confusing with the clients and how they are meant to be used, even though you read about it over and over. Just to be clear, issuing step ca certificate, like how I do in run.sh, is the correct way of doing it as a client right? |
Beta Was this translation helpful? Give feedback.
-
No problem! You can tell the
Yes, OAuth2 is super complicated and confusing. I've been involved since the early days of OAuth 1.0 almost 15 years ago and I still have to go look stuff up in RFCs on a regular basis! The way you're using |
Beta Was this translation helpful? Give feedback.
-
What would you like to be added
A way to use Hydra as OIDC
Why this is needed
Because it's a great open source project!
Beta Was this translation helpful? Give feedback.
All reactions