great-crayon-86888
02/06/2024, 11:47 AMchilly-king-10285
02/06/2024, 11:47 AMchilly-king-10285
02/06/2024, 11:47 AMreturn_to
. 2. An email is sent with a link
or code
method. 3. The user completes the recovery flow by submitting the code
or clicking the link
. 4. The user gets a session and is redirected through the settings
flow. 5. The user submits the settings
flow with an updated password. 6. The user is redirected to the return_to
URL. However, since you mentioned that you do not want to use any redirection, you can call the endpoint with a Accept: application/json
HTTP header. In this case, the response contains the flow without a redirect. Here's an example of how to create a recovery flow: bash curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -c cookies.txt \ "https://{project.slug}.<http://projects.oryapis.com/self-service/recovery/browser|projects.oryapis.com/self-service/recovery/browser>"
Please note that the return_to
URL persists across flows only when a recovery flow transitions into the settings flow. Also, keep in mind that initializing a Settings Flow requires a valid Ory Session Token (for API-based flows) or Ory Session Cookie (for Browser-based flows). For more detailed information, you can refer to the following documentation: - [Advanced redirects](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-advanced-integration#advanced-redirects) - [Recovery](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#recovery) - [Ory API Reference](https://www.ory.sh/docs/reference/api) - [Browser redirects and flow completion](https://www.ory.sh/docs/concepts/redirects#verification-recovery-and-logout) - [User settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#initialize-settings-flow)great-crayon-86888
02/06/2024, 11:53 AMchilly-king-10285
02/06/2024, 11:53 AMchilly-king-10285
02/06/2024, 11:53 AMHttpClient
class. Here's an example of how you can set the Content-Type
and Accept
headers: csharp using (var client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("Content-Type", "application/json"); // Your code here }
In this example, HttpClient
is used to send HTTP requests and receive HTTP responses from a resource identified by a URI. The DefaultRequestHeaders
property gets the default request headers which should be sent with each request. Please note that this is a general example of how to set HTTP headers in .NET and may need to be adjusted based on your specific use case and the requirements of the Ory API.