gorgeous-motorcycle-71764
09/05/2025, 12:10 AMchilly-king-10285
09/05/2025, 12:10 AMchilly-king-10285
09/05/2025, 12:10 AMmetadata
, which is designed to hold arbitrary JSON data. This allows you to attach custom information to each OAuth2 client at creation time. The metadata
field is of type object
and is intended for storing additional data that may be relevant to your application or integration needs. Here is an excerpt from the API schema: json "metadata": { "title": "JSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger.", "type": "object" }
You can include this field in your client creation request, for example: json { "client_name": "My App", "redirect_uris": ["<https://my-app.com/callback>"], "grant_types": ["authorization_code"], "response_types": ["code"], "scope": "openid", "metadata": { "custom_key": "custom_value", "another_key": 123 } }
This custom data will be stored with the client and can be retrieved when you fetch the client details later on. This is supported both via the REST API and the Ory SDKs, as the metadata
field is part of the client model definition in the API specification [source](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json).gorgeous-motorcycle-71764
09/05/2025, 1:18 AMchilly-king-10285
09/05/2025, 1:18 AMchilly-king-10285
09/05/2025, 1:18 AM/admin/oauth2/auth/requests/login?login_challenge={login_challenge}
(or /oauth2/auth/requests/login?login_challenge={login_challenge}
) returns detailed information about the ongoing login request, including a client
object. This client
object contains various fields describing the OAuth2 client, such as client_id
, client_name
, redirect_uris
, and more. Importantly, the client
object also includes a metadata
field, which is described as: > "metadata": {"title": "JSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger.", "type": "object"} This means that if you have stored custom information in the metadata
field when creating the client, it will be included in the response from this endpoint. Here is an example structure from the API response: json { "challenge": "...", "client": { "client_id": "...", "client_name": "...", "redirect_uris": [...], "metadata": { // your custom data here }, ... }, ... }
Therefore, yes, the Hydra Admin API returns the client's metadata as part of the client
object in the login request response [Ory API Reference – getOAuth2LoginRequest](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json).