Hey How can I map oidc token claims to identity m...
# talk-kratos
l
Hey How can I map oidc token claims to identity metadata fields? Documentation refer to page about traits, which doesn't describe working flow for identity metadata. Also, can I map custom oidc claims to my identity traits? I've explored source code and it looks like I can only use predefine claims from selfservice/strategy/oidc/provider.go (Claims type). What if I'm getting custom claims like "user_group" from external OIDC provider and wanna map it on kratos identity trait/metadata?
https://github.com/ory/kratos/blob/master/selfservice/strategy/oidc/provider_generic_oidc.go#L94 You just Unmarshal token claims into concrete struct, so all additional fields are loosing Is it ok?
I found answer about mapping to metadata:
Copy code
metadata_public
metadata_admin
But I looks like custom claims are not supported :(
r
Is this related to your question? https://github.com/ory/kratos/issues/2641
l
Yes Exactly So, it should be implemented in latest version?
Yes, I see Thank you very much!