1. Create External Session via cURL
Follow the steps below to configure your Identity Provider (IDP) and generate an external login session using a cURL request.
Step 1: Open Privacy Settings
Navigate to: Settings → Security → Privacy Setting for your app.


Step 2: Create a New External Session
Click Add identity provider, enter a Provider name, and choose Identity Provider: External Session and Token Type: Authentication Token.
Token Type | How your backend proves identity |
|---|---|
Authentication Token | A fixed shared secret your backend sends. Treat it like a password. |
JSON Web Token (JWT) | A signed token the platform verifies with your Key Id / RSA Public Key (or Secret Key) and Algorithm. |
Custom Workflow | An automation decides. |
This guide uses Authentication Token.
Enter a Fixed Authentication Token. Generate a long random value locally, for example with openssl rand -hex 32, or with a password manager. Store it as a secret.




Step 3: Save and Enable IDP
Once the session is configured, click Save.
Turn on your IDP and click Edit to open its settings.
Under Additional Settings, two options control the login session your backend creates:
External Session Expiry Time (in minutes): how long the session id stays valid. By default it lasts about 2 minutes.
Keep External Session: keeps the external session active instead of making it single-use. Leave it off unless you need to reuse the link.


Step 4: Collect Required Values
Copy the following values from your IDP settings:
Value | Where to find it |
|---|---|
Fixed Authentication Token | IDP settings → Fixed Authentication Token field |
IDP ID | Extracted from the URL of the IDP settings page |
Matrix App Link | The host of your published app, the URL users open the app at |


Step 5: Build and Execute the cURL Request
Replace the placeholders in the cURL template below with your collected values, then run it in Postman or any HTTP client.
curl --location 'https://{matrix app link}/auth/createUserExternalLoginSession' \ --header 'accept: */*' \ --header 'accept-language: en-US,en;q=0.9' \ --header 'content-type: application/json' \ --header 'authorization: Bearer {Fixed auth token}' \ --header 'connection: keep-alive' \ --data-raw '{ "identityProviderId": "{IDP Id}", "formData": { "username": "sample1@mail.com", "name": "TEST1", "email": "sample1@mail.com", "customProperties": {} } }' |
Placeholder | Replace with |
{matrix app link} | Your Matrix app URL (up to /auth) |
{Fixed auth token} | Your Fixed Authentication Token |
{IDP Id} | Your Identity Provider ID |
Step 6: Get the Redirect URL
Paste the cURL into Postman and execute the request.
Copy the redirectURL from the JSON response.


Step 7: Log In to Your Application
Paste the redirect URL into your browser.
You should now be logged in. A new user entry may appear under Settings → Users.
2. Create External Session via Automation
Use an automation to generate external sessions within UnifyApps.
Step 1: Build the Automation
Create an automation with these steps:
Callable trigger, so your backend or another automation can call it.
A Code step that returns the Authorization header: Bearer followed by your Fixed Authentication Token.
A Code step that returns the user's username, name and email.
The Auth by UnifyApps action Create User External Session. Set Application Id (your app), Identity Provider Id (your External Session IdP), Form Data (the user details) and Headers (the Authorization header). It returns a sessionId.
Respond to automation, returning the redirect URL that signs the user in.
Step 2: Update the Auth Token
In the automation, locate the auth token field and replace it with the Fixed Authentication Token you used for your IDP.


Step 3: Configure the Automation Logic
Adjust the automation steps to match your use case and user creation logic.


💡 Redirect URL format: https://{your-app-host}/auth/external/login?sessionId={sessionId}&identityProviderId={idpId}&returnTo={page}
💡 Note: Only include the returnTo parameter if you want to redirect users to a specific page after login. If you want the default homepage, remove the returnTo field entirely.

