boundless-country-57099
12/10/2025, 10:11 PMname.first and name.last traits from an OIDC connection on another Ory instance?
local claims = {
email_verified: false,
} + std.extVar('claims');
{
identity: {
traits: {
// Allowing unverified email addresses enables account
// enumeration attacks, if the value is used for
// verification or as a password login identifier.
//
// Therefore we only return the email if it (a) exists and (b) is marked verified.
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
[if 'name' in claims then 'name' else null]: claims.name,
},
},
}magnificent-energy-493
boundless-country-57099
12/10/2025, 10:37 PMopenid, email and profile, found in this docs page https://www.ory.com/docs/oauth2-oidc/openid-connect-claims-scope-custom
Then my OpenID Connect provider was set to Ory OAuth2, (when the docs say it should be Generic https://www.ory.com/blog/run-sso-oauth2-enterprise-server-open-source) with the same scopes and the following data mapping.
local claims = {
email_verified: false,
} + std.extVar('claims');
{
identity: {
traits: {
// Allowing unverified email addresses enables account
// enumeration attacks, if the value is used for
// verification or as a password login identifier.
//
// Therefore we only return the email if it (a) exists and (b) is marked verified.
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
[if 'given_name' in claims || 'family_name' in claims then 'name' else null]: {
[if 'given_name' in claims then 'first' else null]: claims.given_name,
[if 'family_name' in claims then 'last' else null]: claims.family_name,
},
},
},
}
My Laravel project then used the following to set the traits so they would be the same as my standard Ory Kratos user.
$identity = $session->getIdentity();
$traits = $identity ? $identity->getTraits() : null;
$user = [
'email' => $traits->email ?? null,
'name' => [
'first' => $traits->name?->first ?? null,
'last' => $traits->name?->last ?? null
],
];boundless-country-57099
12/10/2025, 10:37 PMboundless-country-57099
12/10/2025, 10:39 PMboundless-country-57099
12/10/2025, 10:41 PMmagnificent-energy-493
there is parent-company.com which has its own site, services and login, but I want to be able to "Sign in with Parent Company" and login to app.comand the OIDC provider from parent-company is also running on Ory? we have a blogpost for that use case here: https://www.ory.com/blog/run-sso-oauth2-enterprise-server-open-source
magnificent-energy-493
magnificent-energy-493
magnificent-energy-493
boundless-country-57099
12/10/2025, 10:55 PMboundless-country-57099
12/10/2025, 10:56 PMboundless-country-57099
12/11/2025, 1:58 PMmagnificent-energy-493
boundless-country-57099
12/11/2025, 3:06 PM