<@U04UQ68083H> is there a way to identify dynamica...
# ory-copilot
c
@chilly-king-10285 is there a way to identify dynamically registered clients in Hydra during a user's consent flow? If not built in way what would be the recommended approach?
c
A message from kapa.ai
There is no explicit, built-in field in Ory Hydra that directly marks a client as "dynamically registered" during the consent flow, according to the available documentation and API references. The consent request object (as returned by getOAuth2ConsentRequest) does not include a property that indicates whether the client was registered via the dynamic registration endpoint or through the admin API. Recommended Approach: A common and recommended workaround is to use the OAuth2 Client's metadata field to tag dynamically registered clients. When registering a client dynamically (using the OpenID Dynamic Client Registration endpoint), you can include a custom property in the metadata, such as
"metadata": {"dynamically_registered": true}
. During the consent flow, you can then check for this property in the client object attached to the consent request. This approach is also mentioned as a "quick and dirty fix" in community discussions, with the suggestion that a proper field might be added in the future. The consent UI or backend can then check this metadata field to identify dynamically registered clients and apply any special logic as needed [Skip consent flow in default Ory Network UI](https://github.com/ory/network/issues/205). Example: When registering a client:
Copy code
json {   "redirect_uris": ["<https://example.com/callback>"],   "grant_types": ["authorization_code"],   "metadata": {     "dynamically_registered": true   } }
Then, in your consent logic:
Copy code
js if (consentRequest.client.metadata?.dynamically_registered) {   // Handle dynamically registered client }
Summary: There is no built-in flag, but using the metadata field is the recommended and supported way to tag and later identify dynamically registered clients during the consent flow [Skip consent flow in default Ory Network UI](https://github.com/ory/network/issues/205).
c
@chilly-king-10285 the metadata field is not supported by Hydra during dynamic client registration. Is the suggested approach to append this metadata using the admin api?
c
A message from kapa.ai
New message text here