witty-librarian-39711
05/28/2025, 3:55 PMbrief-egg-61061
05/28/2025, 3:55 PMbrief-egg-61061
05/28/2025, 3:55 PMnonce
to prevent replay attacks wherever possible. > ... > If your SDK supports nonce validation, make sure to use a generated value and submit that during the next step. > ... > Obtain an id_token
from Google using the Google SDK. Make sure to also submit the nonce
if you generated one in the step before. > ... > Submit the id_token
and nonce
(as the id_token_nonce
) as part of the updateRegistrationFlow
or updateLoginFlow
request to Ory. > ... > [Flutter code example omitted for brevity] > — [Ory Docs: Google SDK on native apps](https://www.ory.sh/docs/kratos/social-signin/google#using-the-google-sdk-on-native-apps) The provided Flutter code example using the google_sign_in
package does not include any handling of a nonce, and there is no mention of a workaround for this limitation. The documentation suggests that if the SDK does not support nonce, you may proceed without it, but using a nonce is recommended "wherever possible." Summary: If the google_sign_in
Flutter SDK does not allow you to set or retrieve a nonce, you cannot use a nonce in the Ory login flow with this SDK. Ory recommends using a nonce for better security, but acknowledges that it is not always possible with all SDKs, including the Flutter one. There is no documented workaround in the knowledge sources for this limitation. If nonce support is critical for your use case, you may need to look for alternative SDKs or approaches that allow nonce injection, but the Ory documentation does not provide guidance or solutions for this scenario.witty-librarian-39711
05/28/2025, 3:56 PMbrief-egg-61061
05/28/2025, 3:57 PMbrief-egg-61061
05/28/2025, 3:57 PMwitty-librarian-39711
05/28/2025, 3:58 PMbrief-egg-61061
05/28/2025, 3:58 PMbrief-egg-61061
05/28/2025, 3:58 PMgoogle_sign_in
Flutter package and notes its limitation regarding nonce support. No other packages or workarounds are suggested or documented for this use case [Ory Docs: Google SDK on native apps](https://www.ory.sh/docs/kratos/social-signin/google#using-the-google-sdk-on-native-apps). If nonce support is essential for your application, the knowledge sources do not provide a solution or recommend an alternative package at this time.witty-librarian-39711
06/12/2025, 3:36 PMsession_inactive
error means?brief-egg-61061
06/12/2025, 3:37 PMbrief-egg-61061
06/12/2025, 3:37 PMsession_inactive
error means that no active Ory Session was found in the request. This typically occurs when: - There is no valid Ory Session Cookie or Ory Session Token included in the request. - The session has expired or is otherwise inactive. When this error occurs, the API will respond with a 401 status code, indicating that the user is not authenticated and needs to sign in again ([Ory API Reference: toSession](https://www.ory.sh/docs/reference/api)). You may encounter this error in various endpoints, such as when checking the current session with /sessions/whoami
or when accessing self-service flows that require an active session ([Ory API Reference: getSettingsFlow](https://www.ory.sh/docs/reference/api)). In summary, session_inactive
means the system could not find an active session for the request, so authentication is required.witty-librarian-39711
06/12/2025, 6:01 PMsession_inactive
after Google OAuthbrief-egg-61061
06/12/2025, 6:01 PMbrief-egg-61061
06/12/2025, 6:01 PMsession_inactive
error means that Ory Kratos could not find an active session for your request. In the context of the settings flow with the OIDC method (linking Google), this typically happens if: - The session token is missing, invalid, or expired. - The session was invalidated after the OAuth flow (for example, if the identity is disabled or the session is otherwise no longer valid). - The session cookie or token is not being forwarded correctly after the Google OAuth callback. Key points from the knowledge sources: - The session_inactive
error is returned when no active session is found in the request, such as when the Ory Session Cookie or Session Token is missing or invalid ([Ory API Reference: toSession](https://www.ory.sh/docs/reference/api)). - For browser-based settings flows, a valid session cookie must be present. For API/native flows, the session token must be included in the request headers ([Ory API Reference: createBrowserSettingsFlow](https://www.ory.sh/docs/reference/api), [Ory API Reference: getSettingsFlow](https://www.ory.sh/docs/reference/api)). - If the session is inactive after the OAuth flow, it could be due to the identity being disabled or the session being invalidated for another reason (for example, as described in [this GitHub issue](https://github.com/ory/network/issues/397), where an inactive identity causes a 401 error after OIDC login). What you can check: 1. Session Token Validity: Ensure the session token you are sending is current and valid. If the session expired during the OAuth flow, you will get session_inactive
. 2. Identity State: If the identity was disabled or set to inactive, the session will be invalid after OAuth, resulting in this error. 3. Token Forwarding: Make sure the session token or cookie is correctly forwarded in all requests after the Google OAuth callback. 4. Session Expiry: If your settings flow takes too long or the session expires during the process, you will need to re-authenticate. If you have confirmed all of the above and still encounter the error, it may be related to the state of the identity (e.g., disabled) or a misconfiguration in your flow. The knowledge sources do not provide a more specific troubleshooting guide for this scenario, but these are the most common causes for session_inactive
in the settings flow with OIDC ([Ory API Reference: getSettingsFlow](https://www.ory.sh/docs/reference/api), [GitHub Issue: OIDC callback returns 401 to browser when identity state is inactive](https://github.com/ory/network/issues/397)).witty-librarian-39711
06/12/2025, 6:13 PMbrief-egg-61061
06/12/2025, 6:13 PMbrief-egg-61061
06/12/2025, 6:14 PMAuthorization: Bearer <session-token>
header or as the X-Session-Token
header. For browser flows, the session cookie must be present in the Cookie
header. Here’s how you can verify token forwarding: - With cURL (API/native flow): sh curl -H "Authorization: Bearer {your-session-token}" \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/sessions/whoami|PROJECT_SLUG.projects.oryapis.com/sessions/whoami>"
This checks if the session token is valid and active. If you get a 200 OK and session data, the token is forwarded and accepted. If you get a 401 with session_inactive
, the token is not being forwarded or is invalid [Check session status](https://www.ory.sh/docs/identities/sign-in/check-session-token-cookie-api). - With Ory SDK (Node/Express example): js const session = await ory.toSession({ xSessionToken: sessionToken, })
Make sure the sessionToken
variable contains your valid session token and is passed as shown above [Check session status](https://www.ory.sh/docs/identities/sign-in/check-session-token-cookie-api). - For browser flows: The session cookie should be automatically included by the browser if it is set for the correct domain and path. You can inspect the network requests in your browser’s developer tools to confirm that the Cookie
header contains the ory_kratos_session
value. Summary: Check your network requests to ensure the session token is present in the Authorization
or X-Session-Token
header (for API/native), or the session cookie is present in the Cookie
header (for browser). If these are set correctly and you still get session_inactive
, the issue is likely elsewhere [Check session status](https://www.ory.sh/docs/identities/sign-in/check-session-token-cookie-api).witty-librarian-39711
06/12/2025, 6:16 PMbrief-egg-61061
06/12/2025, 6:16 PMbrief-egg-61061
06/12/2025, 6:16 PMwitty-librarian-39711
06/12/2025, 6:17 PMbrief-egg-61061
06/12/2025, 6:17 PMbrief-egg-61061
06/12/2025, 6:17 PMsession_inactive
error after the Google OAuth flow in the settings (OIDC link) flow, the knowledge sources do not provide a definitive solution or further troubleshooting steps for this scenario. The documentation and issues reviewed indicate that session_inactive
is returned when no active session is found, typically due to missing, invalid, or expired session tokens, or an inactive identity. If you have verified that none of these apply, and token forwarding is correct, then the cause is unclear based on the available documentation ([Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api), [GitHub Issue: OIDC callback returns 401 to browser when identity state is inactive](https://github.com/ory/network/issues/397)). I'm sorry, but the knowledge sources do not contain enough information to explain or resolve this specific situation where all session and identity parameters are valid, yet session_inactive
is still returned.witty-librarian-39711
06/12/2025, 6:32 PMbrief-egg-61061
06/12/2025, 6:32 PMbrief-egg-61061
06/12/2025, 6:33 PMPOST /settings
endpoint is used to complete a settings flow in Ory (Kratos). This endpoint allows a user to update their settings, such as password, profile traits, or link/unlink social sign-in providers (OIDC), depending on which methods are enabled in your configuration. ### How it works - API-initiated flows: - Send a JSON body with the updated settings. - On success, you receive HTTP 200 and a JSON body with the session token. - On errors (expired flow, validation errors, missing/invalid session), you receive appropriate HTTP status codes (400, 401, 403, 303). - Browser flows: - If the request does not have Accept: application/json
, you are redirected (HTTP 303) to the appropriate UI or error page. - If the request has Accept: application/json
, you receive a JSON response with the updated identity or error details. ### Required parameters - flow (query parameter): The ID of the settings flow, usually from the flow
query parameter in your app's URL. - Session Token or Cookie: - For API flows: X-Session-Token
header. - For browser flows: session cookie in the Cookie
header. ### Example use cases - Update password (method: password
) - Update profile traits (method: profile
) - Link/unlink OIDC providers (method: oidc
) ### Error handling - `session_refresh_required`: The user must re-authenticate. - `security_csrf_violation`: CSRF token is invalid or missing. - `session_inactive`: No active session found. - `security_identity_mismatch`: The session does not match the identity. - `browser_location_change_required`: The browser needs to open a specific URL (often in social sign-in flows). For more details, see the [Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api). --- In summary: POST /settings
is the endpoint to submit changes to a user's settings in Ory, handling password, profile, and OIDC methods, with different behaviors for API and browser flows, and requires a valid session and flow ID to operate correctly.witty-librarian-39711
06/12/2025, 6:35 PMbrief-egg-61061
06/12/2025, 6:35 PMbrief-egg-61061
06/12/2025, 6:35 PMPOST /self-service/settings
, the session_inactive
error means that Ory could not find an active session associated with the request. According to the knowledge sources, this can happen in the following cases: - No valid session cookie is included in the request. The browser flow relies on the presence of a valid Ory Kratos session cookie in the Cookie
header. If this cookie is missing, invalid, or expired, the request will result in a session_inactive
error ([Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api)). - The session has expired or is otherwise inactive. If the user's session has expired or has been invalidated (for example, due to logout or session revocation), the error will be returned. - The session token/cookie is not forwarded correctly. If your application is acting as a proxy or server-side handler, you must ensure that the original session cookie from the browser is forwarded to Ory. If not, Ory will not be able to validate the session ([Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api)). - The identity associated with the session is inactive. If the identity has been disabled or set to an inactive state, the session will be considered inactive, and the error will be returned ([GitHub Issue: OIDC callback returns 401 to browser when identity state is inactive](https://github.com/ory/network/issues/397)). Summary: For browser flows, session_inactive
during POST /self-service/settings
typically means the session cookie is missing, invalid, expired, not forwarded, or the identity is inactive. The request will not succeed until a valid, active session is present in the browser and properly sent to Ory. You can find more details in the [Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api).witty-librarian-39711
06/12/2025, 9:49 PMbrief-egg-61061
06/12/2025, 9:49 PMbrief-egg-61061
06/12/2025, 9:49 PMupstream_parameters
that can be configured and passed to upstream identity providers (such as Google) in Ory flows (login, registration, and settings): - login_hint: Suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session. - hd: Limits the login/registration process to a specific Google Organization (e.g., <http://mycollege.edu|mycollege.edu>
). - prompt: Specifies whether the Authorization Server prompts the End-User for reauthentication and consent (e.g., select_account
). - auth_type: Used to specify authentication type, such as reauthenticate
(mentioned in form example). These parameters can be passed in the form body as follows: html <form action="https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/login?flow=<flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/login?flow=<flow-id>>" method="POST"> <input type="submit" name="provider" value="google" /> <input type="hidden" name="upstream_parameters.login_hint" value="foo@bar.com" /> <input type="hidden" name="upstream_parameters.hd" value="bar.com" /> <input type="hidden" name="upstream_parameters.prompt" value="select_account" /> <input type="hidden" name="upstream_parameters.auth_type" value="reauthenticate" /> </form>
Supported parameters according to the knowledge sources: - login_hint
- hd
- prompt
- auth_type
For more details, see the [Advanced Integration documentation](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-advanced-integration#login) and [Google provider additional parameters](https://www.ory.sh/docs/kratos/social-signin/google#additional-parameters). If you need to use other parameters, the knowledge sources do not mention any beyond those listed above.witty-librarian-39711
06/12/2025, 10:26 PMbrief-egg-61061
06/12/2025, 10:26 PMbrief-egg-61061
06/12/2025, 10:27 PMyaml selfservice: methods: password: enabled: true oidc: enabled: true profile: enabled: true # ...
- `password`: Allows users to update their password. - `oidc`: Allows users to link/unlink social sign-in providers (e.g., Google, Facebook). - `profile`: Allows users to update identity traits (e.g., email, name) ([Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings)). --- ### Privileged Session Max Age Controls how long a session can be used to update privileged fields (like password or email) before requiring re-authentication: yaml selfservice: flows: settings: privileged_session_max_age: 1m
- If the session is older than this value, the user must re-authenticate before updating privileged fields ([Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings)). --- ### Required Authentication Assurance Level (AAL) Require a certain AAL (e.g., multi-factor authentication) for accessing the settings flow: yaml selfservice: flows: settings: required_aal: highest_available
- Forces users to provide the highest available authentication assurance level before changing settings ([Account recovery and password reset: Configuration](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset#configuration)). --- ### UI and Redirect URLs You can configure the UI and redirect URLs for the settings flow (not shown in YAML in the docs, but referenced in issues and config dumps): - `kratos_selfservice_flows_settings_ui_url`: URL for the settings UI. - `kratos_selfservice_flows_settings_after_default_browser_return_url`: Redirect after settings update. - `kratos_selfservice_flows_settings_after_password_default_browser_return_url`: Redirect after password update. - `kratos_selfservice_flows_settings_after_profile_default_browser_return_url`: Redirect after profile update. - `kratos_selfservice_flows_settings_lifespan`: Lifespan of the settings flow. These are visible in configuration dumps and issues ([GitHub Issue: Unable to select custom Identity Schema](https://github.com/ory/network/issues/54)). --- Note: The knowledge sources do not provide a full exhaustive list of every possible settings flow configuration, but the above are the main documented options for controlling the behavior of the settings flow in Ory Kratos. If you need more advanced or undocumented options, please refer to the official Ory documentation or configuration reference.witty-librarian-39711
06/12/2025, 10:29 PMbrief-egg-61061
06/12/2025, 10:29 PMbrief-egg-61061
06/12/2025, 10:30 PMyaml selfservice: flows: settings: after: oidc: default_browser_return_url: <https://end-up-here-after-settings-with-oidc/>
This setting controls where the user is redirected after successfully linking (or unlinking) an OIDC account in the settings flow. If this is not set, the default redirect URL for the settings flow will be used instead ([Ory Concepts: Browser redirects and flow completion](https://www.ory.sh/docs/concepts/redirects#redirect-flows)). Summary: Yes, there is a config for redirecting after OIDC account linking in the settings flow: selfservice.flows.settings.after.oidc.default_browser_return_url
. If you need more details or examples, see the [Ory Concepts: Browser redirects and flow completion](https://www.ory.sh/docs/concepts/redirects#redirect-flows).witty-librarian-39711
06/12/2025, 10:33 PMbrief-egg-61061
06/12/2025, 10:33 PMbrief-egg-61061
06/12/2025, 10:33 PMsession_inactive
error in Ory Kratos. The session_inactive
error occurs when no valid session is found—typically due to missing, expired, or invalid session cookies or tokens, or if the identity is inactive. The knowledge sources focus on ensuring that a valid session is present and forwarded, but do not mention a configuration key that would alter the behavior of this error or its handling. If you are encountering session_inactive
, you should check that your session management settings (such as session lifespan and cookie forwarding) are correct, but there is no documented config to change how session_inactive
is triggered or handled [Ory API Reference: updateSettingsFlow](https://www.ory.sh/docs/reference/api).witty-librarian-39711
06/13/2025, 12:07 PMbrief-egg-61061
06/13/2025, 12:07 PMbrief-egg-61061
06/13/2025, 12:07 PMory_kratos_session
cookie is missing in the OIDC callback, the most common reasons according to the knowledge sources are: 1. Cookie Domain or Path Issues: If Ory Kratos and your application/UI are running on different subdomains or domains, the session cookie may not be set or sent correctly. Cookies work best when both the UI and Ory Kratos are on the same domain. If they are on different subdomains, you must set the cookie domain explicitly in the Kratos config (session.cookie.domain
). If they are on different top-level domains, cookies will not work at all ([CSRF troubleshooting](https://www.ory.sh/docs/kratos/debug/csrf)). 2. Missing or Misconfigured Continuity Cookie: During the OIDC flow, Kratos uses a continuity cookie to resume the session after the callback. If this cookie is not set with the correct domain, Kratos cannot access it after the redirect, resulting in "no resumable session found" and the session cookie not being set. This is a known issue when running Kratos under a subdomain and the continuity cookie is not configured to be accessible across subdomains ([GitHub Issue: ory_kratos_continuity cookie has no domain set](https://github.com/ory/kratos/issues/2713)). 3. Secure and SameSite Cookie Attributes: If you are running over HTTP (not HTTPS) and not in --dev
mode, cookies with the Secure
flag will not be sent by the browser. Also, SameSite
settings can prevent cookies from being sent in cross-origin requests. For local development, use --dev
mode; for production, always use HTTPS ([CSRF troubleshooting](https://www.ory.sh/docs/kratos/debug/csrf)). 4. Mixing 127.0.0.1 and localhost: These are treated as different domains by browsers. Make sure you use one consistently across your configuration ([CSRF troubleshooting](https://www.ory.sh/docs/kratos/debug/csrf)). 5. Session Hook Not Enabled: If you do not have the session
hook enabled in your OIDC registration flow, the session will not be created after OIDC sign-in, and thus no session cookie will be set ([Social sign-in configuration](https://www.ory.sh/docs/self-hosted/kratos/configuration/oidc), [Successful registration](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#successful-registration)). Summary: The most likely reasons for a missing ory_kratos_session
cookie in the OIDC callback are cookie domain/path issues, missing or misconfigured continuity cookie, secure/SameSite attribute problems, inconsistent domain usage, or missing session hook in your OIDC flow configuration. Check your Kratos configuration and deployment setup for these common pitfalls.witty-librarian-39711
06/16/2025, 8:38 AMbrief-egg-61061
06/16/2025, 8:38 AMbrief-egg-61061
06/16/2025, 8:39 AMlink
option with OIDC & Password methods enabled](https://github.com/ory/kratos/issues/4185), [Discussion: How to link Apple provider using native auth?](https://github.com/ory/kratos/discussions/4356). Summary: There is currently no supported way to perform account linking (settings flow OIDC link) for native apps in Ory Kratos. This feature is planned for a future release, but is not available as of now.witty-librarian-39711
06/16/2025, 12:39 PMbrief-egg-61061
06/16/2025, 12:39 PMbrief-egg-61061
06/16/2025, 12:39 PMid_token
) directly to Ory Kratos for account linking in the settings flow. - The documentation and GitHub discussions confirm that while you can pass an id_token
for login and registration using native SDKs, this is not yet supported for the settings/account linking flow. The settings flow for account linking (linking a social account to an existing identity) only supports browser-based flows, not API/native flows, and does not accept an id_token
for linking [Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#link-and-unlink-from-google-facebook-github--openid-connect--oauth-20), [Discussion: How to link Apple provider using native auth?](https://github.com/ory/kratos/discussions/4356), [Github Issue: Settings flow does not have link
option with OIDC & Password methods enabled](https://github.com/ory/kratos/issues/4185). Summary: At this time, you cannot pass an IDP token to Kratos for account linking in the settings flow. This feature is not yet implemented for API/native flows; only browser-based flows are supported for account linking.witty-librarian-39711
06/16/2025, 12:40 PMbrief-egg-61061
06/16/2025, 12:41 PMbrief-egg-61061
06/16/2025, 12:41 PMlink
option with OIDC & Password methods enabled](https://github.com/ory/kratos/issues/4185). If you need this functionality, you will need to wait for a future release where native account linking is supported, as it is not available at this time.witty-librarian-39711
06/16/2025, 12:58 PMbrief-egg-61061
06/16/2025, 12:58 PMbrief-egg-61061
06/16/2025, 12:58 PMwitty-librarian-39711
06/18/2025, 10:27 AMbrief-egg-61061
06/18/2025, 10:27 AMbrief-egg-61061
06/18/2025, 10:27 AMGET /admin/identities/{id}
with the include_credential=password
query parameter. This will return the identity's credentials, including the password credential if it exists. Example request: GET /admin/identities/{id}?include_credential=password
If the response includes a password
credential object, the account has a password set. If the password
credential is missing, the account does not have a password. The response will look like this if a password is present: json "password": { "type": "password", "identifiers": [ "<mailto:example@ory.sh|example@ory.sh>" ], "config": { "hashed_password": "$2a$12$...." }, "version": 0, "created_at": "...", "updated_at": "..." }
If the password credential is not present, the account does not have a password set [Ory API Reference: getIdentity](https://www.ory.sh/docs/reference/api), [Github Issue: include_credential query parameter](https://github.com/ory/network/issues/425). Summary: Use the Admin API to fetch the identity with include_credential=password
and check if the password
credential exists in the response.witty-librarian-39711
06/18/2025, 10:27 AMbrief-egg-61061
06/18/2025, 10:27 AMbrief-egg-61061
06/18/2025, 10:28 AMinclude_credential=password
parameter, which requires privileged access and an API key. This endpoint is not accessible from the frontend for security reasons [Export identities](https://www.ory.sh/docs/kratos/manage-identities/export-user-accounts-identities). In summary, checking if an account has a password must be done server-side using the Admin API, not from the frontend.witty-librarian-39711
06/19/2025, 9:28 AMbrief-egg-61061
06/19/2025, 9:28 AMbrief-egg-61061
06/19/2025, 9:28 AMwitty-librarian-39711
06/20/2025, 10:08 AMbrief-egg-61061
06/20/2025, 10:08 AMbrief-egg-61061
06/20/2025, 10:08 AMsession
hook is configured for the OIDC registration flow, the user is automatically signed in after registration. Otherwise, they may need to log in again [Social sign-in configuration](https://www.ory.sh/docs/self-hosted/kratos/configuration/oidc). 8. User is redirected to your application: The user is redirected to the post-registration URL configured in your Ory settings. What the user sees: - A registration page with a "Sign up with Google" button. - Google’s login and consent screens. - After successful registration, they are redirected back to your app, signed in as a new user [Social sign-in overview](https://www.ory.sh/docs/kratos/social-signin/overview). Example payload for registration flow with Google: json { "id": "c1f4dfd1-3559-4cd3-b6f6-4a83689a41bd", "ui": { "nodes": [ { "type": "input", "group": "oidc", "attributes": { "name": "provider", "type": "submit", "value": "google" }, "meta": { "label": { "text": "Sign up with google" } } } ] } }
[Registration with Google, Facebook, GitHub, ..., OpenID Connect / OAuth 2.0](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#registration-with-google-facebook-github--openid-connect--oauth-20) For more details and setup instructions, see the [Ory social sign-in documentation](https://www.ory.sh/docs/kratos/social-signin/overview).