I want to set a top level claim to my Ory Hydra Ac...
# ory-network
q
I want to set a top level claim to my Ory Hydra Access Token output. A
username
field. Currently setting
username
to
session.access_token
in OAuth2Consent respond. Also trying to enable
oauth2.allowed_top_level_claims
in my Ory Network OAuth2 Config. However claim gets set to
ext
object, instead of top level. It seems like Ory Network has this configuration field mapped to the
oauth2.session.allowed_top_level_claims
, where as the Open Source project is looking at the
oauth2.allowed_top_level_claims
. Can you check? Open Source: https://github.com/ory/hydra/blob/master/driver/config/provider.go#L91 Ory Network Config in ScreenShot:
Is this configuration parsing done at client side so maybe I can bypass that and set the configuration at correct path?
docs also state
oauth2.allowed_top_level_claims
is the correct path: https://www.ory.sh/docs/hydra/guides/jwt#adding-custom-claims-top-level-to-the-access-token
Is the code for Ory Network
setProject
operation and its spec closed source? I can't find where this configuration schema is misconfigured 🤔
h
Thank you for the report! It is possible that this field is not yet in our setProject API. If you create an issue for it we can tackle this relatively quickly
hm, i did find this in our code, i think it is supported
Try:
ory patch oauth2-config --replace /oauth2/session/allowed_top_level_claims=["foo","bar"] --project abcde
q
@high-optician-2097 sorry for not being clear enough. the problem is, even though I set
oauth2/session/allowed_top_level_claims
with the command you sent, or via
update
command. Both cases, I only get
ext.username
. Even though I can validate that
oauth2.session.allowed_top_level_claims
is set. I think the problem is, Ory Hydra is using
oauth2.allowed_top_level_claims
whereas the Ory Cloud
setProject
is configured to use
oauth2.session.allowed_top_level_claims
. So this configuration never works. The documentation also states that this variable should be under
oauth2.
, not
oauth2.session.
Where should I create an issue for this?
h
Oh I see, that could be a problem in this case! The best place would be github.com/ory/network
q
@high-optician-2097 Creating an issue! Thanks for the reference!
h
thank you for debugging 🙂
👍 1
q
Created ory/network#232 for this 👍
❤️ 2
169 Views