Replies: 2 comments 4 replies
-
Hello @trautonen You can retrieve the OIDC / OAuth 2.0 access, refresh, and ID tokens issued for the identity by social sign-in providers using the Ory CLI, cURL, JavaScript, or Go. These tokens are issued only when the Identity signs up with a social sign-in provider or links a new social sign-in provider to their account. Ory CLI ory get identity "{identity.id}" --project "{project.id}" \
-i oidc --format yaml cURL
JavaScript import { Configuration, IdentityApi } from "@ory/client"
const identity = new IdentityApi(
new Configuration({
basePath: `https://${process.env.ORY_PROJECT_SLUG}.projects.oryapis.com`,
accessToken: process.env.ORY_API_KEY,
}),
)
export async function getTokens(identityId: string) {
return await identity
.getIdentity({ id: identityId, includeCredential: ["oidc"] })
.then(({ data }) => data)
} You get something back like this for example:
Please note that this only returns the initial access/refresh token. There is a PR open to add functionality to get a new token on every login: #2428 For more details, you can refer to the documentation. Let me know if that solved your problem please! |
Beta Was this translation helpful? Give feedback.
-
The registration is not done by the OIDC provider. The registration is done using self service flow or admin APIs in Kratos. Hydra issues the token on login, but as noted in #2428 this does not seem to be possible at the moment. |
Beta Was this translation helpful? Give feedback.
-
I've set up Hydra - Kratos integration using the Kratos OIDC provider but I cannot figure how to retrieve the access tokens generated by Hydra. By looking at https://github.com/ory/kratos/blob/master/selfservice/strategy/oidc/strategy_login.go I can't see where the token goes so that it would be accessible by the user application. The Kratos session identity only includes password credentials and not OIDC.
Should I handle the login somehow different or is that just something that is not supported?
Beta Was this translation helpful? Give feedback.
All reactions