gray-library-49237
08/23/2024, 12:38 AMchilly-king-10285
08/23/2024, 12:38 AMchilly-king-10285
08/23/2024, 12:38 AMgray-library-49237
08/23/2024, 12:39 AMchilly-king-10285
08/23/2024, 12:39 AMchilly-king-10285
08/23/2024, 12:39 AMGET /admin/sessions/{id}
endpoint. This endpoint is useful for getting a session object with all specified expandables that exist in an administrative context. The expand
query parameter can be used to include data for certain attributes in the response which are not returned by default to improve performance. For example, you can use ?expand=Identity&expand=Devices
to include data for the Identity and Devices attributes in the response. Here is an example of a session object: json { "active": true, "authenticated_at": "2019-08-24T14:15:22Z", "devices": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "ip_address": "string", "location": "string", "user_agent": "string" } ], "expires_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", }
In this example, the devices
attribute is an array of device objects. Each device object contains an id
, ip_address
, location
, and user_agent
. For more detailed information on how to set missing values for device information in a session, you may need to refer to the official Ory documentation or seek assistance from the Ory community. [Source](https://www.ory.sh/docs/reference/api)gray-library-49237
08/29/2024, 1:55 AMchilly-king-10285
08/29/2024, 1:55 AMchilly-king-10285
08/29/2024, 1:55 AMctx
object which contains the following properties: - `flow`: Contains information about the registration flow such as its ID, expiration time, issued time, request URL, and more. - `identity`: Contains information about the user's identity such as their ID, traits (like email and name), and more. - `request_headers`: Contains the request headers. - `request_method`: Contains the request method. - `request_url`: Contains the request URL. Here is an example of all properties of the ctx
object for a registration flow: json { "ctx": { "flow": { "expires_at": "2023-01-31T12:19:35.782238Z", "id": "cec1c06e-48eb-4f9d-abf1-2e287371f4eb", "issued_at": "2023-01-31T11:19:35.782238Z", "request_url": "<https://playground.projects.oryapis.com/self-service/registration/browser?return_to=>", "type": "browser", "ui": { "action": "<http://localhost:4455/self-service/registration?flow=cec1c06e-48eb-4f9d-abf1-2e287371f4eb>", "method": "POST", } }, "identity": { "created_at": "0001-01-01T00:00:00Z", "id": "3a5293f1-f4d6-49f4-b34f-6da62c360604", "traits": { "email": "[[email protected]](<https://www.ory.sh/cdn-cgi/l/email-protection>)" }, }, "request_headers": { "Accept": [ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ], "Accept-Encoding": ["gzip"], "Accept-Language": ["en-GB,en-US;q=0.9,en;q=0.8"], "Content-Length": ["180"], "Content-Type": ["application/x-www-form-urlencoded"], }, "request_method": "POST", "request_url": "<https://playground.projects.oryapis.com/self-service/registration?flow=cec1c06e-48eb-4f9d-abf1-2e287371f4eb>" } }
You can use these properties to transform the identity data from Ory to a format that your external system understands. [Source](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#jsonnet-templating)