many-parrot-95660
11/02/2023, 6:29 PMidentities
after the OAuth2 dance.
Where I'm at is that I have an ORY access token that looks like ory_at...
and I think I want to hit /sessions/whoami
(or maybe some admin endpoint?) but I don't know how to go from ory_at...
to a session token (which it sounds like is a different thing?)
Thanks!
(also, I posted the same question in different words on SO: https://stackoverflow.com/questions/77411991/ory-network-get-identity-via-oauth2-flow)many-parrot-95660
11/02/2023, 6:30 PMproud-plumber-24205
11/03/2023, 7:44 AMmany-parrot-95660
11/03/2023, 1:39 PM/whoami
rather than the userinfo
if possible.
The specific usecase here involves figuring out if the user has a specific property which is incuded using identity schemas.many-parrot-95660
11/03/2023, 1:41 PMproud-plumber-24205
11/03/2023, 1:48 PM/whoami
- this also defeats the purpose of OAuth! (see here https://www.ory.sh/docs/hydra/concepts/before-oauth2)
Kratos in any case sets a cookie scoped to the project domain - which means third party apps cannot just call /whoami
.
If your app is on the same domain as kratos then why do you need to do an OAuth dance in the first place?
For the userinfo
api, the access token can include all sorts of information. That's what the consent flow is for.
In the case of Ory we by default add the traits associated with the `profile`scope
(see here https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/routes/consent.ts#L40C40-L40C40).
You can of course have the project set additional data inside a custom consent route.limited-photographer-61008
11/03/2023, 1:51 PMlimited-photographer-61008
11/03/2023, 1:51 PMmany-parrot-95660
11/03/2023, 2:15 PM/userinfo
payload makes sense as well. We do that internally for places where we generate our own tokens (totally different user set and usecase).
I think my mental model is SAML-ish if that helps explain my confusion. I'm also possibly confused about OAuth vs OCID? In my mental model, the user clicks the "Sign in with <ORY project>" and I end up with a OCID, which in my mental model is the same as what I'd expect in identities
but I guess that's where I'm wrong?many-parrot-95660
11/03/2023, 2:19 PM/userinfo
access_token
• Customer adds the info I need to the /userinfo
id_token
Does that sound right?limited-photographer-61008
11/03/2023, 2:27 PMopenid
scope, then it turns it in to OIDC, and you’ll get an id token along with the access token back. The id token payload is the same as what you’d get in the response to the /userinfo endpointlimited-photographer-61008
11/03/2023, 2:31 PMmany-parrot-95660
11/03/2023, 3:21 PM