witty-noon-28853
07/30/2025, 2:45 PMbrief-egg-61061
07/30/2025, 2:45 PMbrief-egg-61061
07/30/2025, 2:45 PM/sessions/whoami
endpoint allows you to retrieve the current session details, but it requires either an Ory Session Cookie or an Ory Session Token, not an OAuth2 access token. The documentation and SDK examples consistently show the use of session tokens or cookies for session lookups, not OAuth2 access tokens [Check session status](https://www.ory.sh/docs/identities/sign-in/check-session-token-cookie-api) [Using Ory Session Token](https://www.ory.sh/docs/kratos/session-management/overview#using-ory-session-token). - The administrative API to get session details (getSession
) requires an Ory access token with administrative privileges, not an OAuth2 access token issued to a user [Getting session details](https://www.ory.sh/docs/kratos/session-management/list-revoke-get-sessions#getting-session-details). - OAuth2 access tokens are typically used to access protected resources or fetch user profile information from the userinfo endpoint, but not for session management or session ID retrieval [Fetch user profile](https://www.ory.sh/docs/polis/guides/npm-library#fetch-user-profile). In summary, the knowledge sources do not describe a method to obtain the current session ID for an identity using only a valid OAuth2 access token. Session management endpoints require session tokens, cookies, or administrative access tokens.