Runtime with Legation
Add customer sign-in to an application running on Runtime.
Who this is for: teams running a web app on Runtime who want Legation for their customers' sign-in. What you get: your Runtime application signs users in through its Legation environment.
Neither product requires the other. This guide connects them through your application's configuration.
Prerequisites
- An application deployed on Runtime. See Deploy your first application.
- A Legation environment and its endpoint URL. See Get started with Legation.
Register your application's origins
Register the URL of your Runtime application, any custom domains and your exact redirect URLs for the Legation environment. See Origins and redirect URLs.
Store the Legation endpoint as configuration
Add the endpoint as an environment variable on the Runtime application, rather than hard-coding it. Choose a variable name that suits your app.
Create the client from that variable
Create the Legation client with that value as baseURL. See Get started with Legation.
Redeploy and test
Redeploy or restart the Runtime application so it picks up the variable. Sign up a test user and check the session.
Common failures
| Symptom | Fix |
|---|---|
INVALID_ORIGIN after adding a custom domain | Register the new domain with id0n. |
| Client still points at the old endpoint | Restart the Runtime application after changing the variable. |