flaky-kilobyte-10585
06/14/2023, 9:44 AMchilly-king-10285
06/14/2023, 9:44 AMchilly-king-10285
06/14/2023, 9:45 AMauthentication_methods
field, which is an array of objects containing the authentication methods used by the user during the session. Each object in the array has a method
field that indicates the specific authentication method used, such as password
, oidc
, totp
, webauthn
, or lookup_secret
. Here's the API route for this endpoint: GET /sessions/whoami
You can find more information about this endpoint in the [Ory Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api#check-who-the-current-http-session-belongs-to). Remember to include one of the following headers in your request to authenticate the user: - Cookie
HTTP header containing an Ory Kratos Session Cookie - Authorization: bearer <ory-session-token>
HTTP header with a valid Ory Kratos Session Token - X-Session-Token
HTTP header with a valid Ory Kratos Session Tokenflaky-kilobyte-10585
06/14/2023, 9:47 AMchilly-king-10285
06/14/2023, 9:48 AMchilly-king-10285
06/14/2023, 9:49 AMGET /identities/{id}
Replace {id}
with the user's identity ID, which you can obtain from the session information. In the response, you will find the traits
field, which contains the user's identity traits. If the user has logged in using an OIDC provider, you should see a field like oidc
or oauth2
within the traits
object. Inside this field, you will find information about the OIDC provider, such as the provider's name or issuer. For example, if the user logged in using Google as an OIDC provider, you might see something like this in the traits
field: json { "oidc": { "google": { "issuer": "<https://accounts.google.com>", "subject": "1234567890", "profile": { "email": "<mailto:user@example.com|user@example.com>", "name": "John Doe" } } } }
In this example, you can see that the user logged in using Google as their OIDC provider. You can find more information about the "Get an Identity" API endpoint in the [Ory Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api#get-an-identity).flaky-kilobyte-10585
06/14/2023, 9:58 AMchilly-king-10285
06/14/2023, 9:59 AMchilly-king-10285
06/14/2023, 9:59 AM