Hello. We're trying to implement OAuth with Ory Cl...
# talk-hydra
p
Hello. We're trying to implement OAuth with Ory Cloud. But we're not getting the email address from the userinfo endpoint. Found an issue described here https://github.com/ory/kratos/issues/3060 Any idea how to setup what gets passed via userinfo on the cloud?
i
You have to implement your own login, respectively consent provider. Here is an example https://github.com/ory/hydra-login-consent-node. The corresponding concept is also part of hydras documentation.
p
But we're using cloud.
There are no grants, what should we be requesting?
i
I assume you're talking about scopes. Typically, you have to configure the allowed scopes during the registration of a client in hydra. If you don't configure any, you'll get an empty permission dialogue, respectively list upon which the dialogue is built. But this is related to hydra only. Hydra by itself doesn't know anything about profile attributes. These are managed by kratos. That way, if there is an integration between kratos and hydra, which effectively is just a login provider implementation, I was talking about in my reply to your question, that implementation must implement a mapping between possible oidc scopes and attributes available in kratos so that upon a successful execution of the authorization grant flow the session created on hydra side has these attributes.
I've never used the cloud offering. For that reason I'm not aware about available limitations.
Depending on your scenarios - oidc for 1st party or 3rd party usage, it might be beneficial not to rely on the information available in hydra and use services like oathkeeper, or alike to verify and enrich the incoming request.
Oidc for 1st party context is however mostly a pain in the ass
c
@victorious-controller-5388 do you happen to know anything about this?
@magnificent-energy-493
v
email,profile IIRC
@plain-farmer-93069 I forgot where I inferred that from, but we wouldn't get the user email in the /userinfo endpoint if we didn't request it
p
Yep, unfortunately there's no email there... Here's the raw response from the flow.
Perhaps a hint lies here. Note how there are no permissions...
i
Does your client actually send the email scope when starting the authorization grant flow? If not, that could be the explanation why you don't get that data
p
Damn, that was it. Thanks.