Customising authentication redirects

Overview

After the end-user completes the authentication flow, they will be redirected to a default final url that's either a success or failure screen before they go back to your app.

These urls can be customized when you're calling one of the /auth endpoints.


Authentication Flow Final URL

When the user authenticates a health account (e.g. Oura), before they go back to your app, they see a final URL (screen) of the authentication flow is either a success or failure screen.

Default Success Redirect URL
Default Failure Redirect URL

The final url will append the following parameters:

  • user_id (not Null)

  • resource (not Null)

  • reference_id (can be Null - if you did not pass it in the auth endpoint).

Success Auth URL (Example)
https://widget.tryterra.co/session/demo/success?user_id=bc205b50-dabe-4680-9d35-38517b915dc1&resource=GOOGLE&reference_id=null 

How to Customize the Redirect URLs?

Terra provides these urls by default, and they can also be customized in the /auth endpoints. They can be specified in the body of the authentication request as:

  • auth_success_redirect_url

  • auth_failure_redirect_url


Different ways to Customize the Auth Result URL

You can redirect to a:

  • Web Page: A specific page on your web application, including any useful query parameters.

    • Example: https://somereallycoolcompany.com?terra_auth_success=true

  • Deep Link: A deep link into your mobile application.

    • Example: reallycoolapp://success

Mobile-based integrations

Last updated

Was this helpful?