Prerequisites
- A Portal and its application. To create them, read Universal Portals Quickstart. To configure the application yourself, read Configure an Application for Universal Portals.
-
The portal URL:
YOUR_DOMAINis your custom domain, or your Auth0 domain if you don’t have a custom domain.{slug}is the portal slug. The URL opens the Portal’s default page. If the Portal has no default page, users are presented with a “Page not found” error message. To configure a default page, read Configure Universal Portals. -
If you want to use Portals with Organizations:
- The portal application allows Organizations. To learn more, read Configure an Application for Universal Portals.
- The user is a member of the Organization.
- For a business Portal, the user has the Organization permissions that the components need. To learn more, read My Organization API.
Open a Portal from a web application
Link to the portal URL from your application:Open a Portal from a native application
Native to Web SSO transfers the user’s session from your Native Application to the Portal. The Native Application exchanges its refresh token for a single-use session transfer token, and then opens the Portal in an in-app browser with that token in the URL. Before you start, configure Native to Web SSO on your Native Application. To learn more, read Configure and Implement Native to Web SSO. Then configure the portal application to accept session transfer tokens. To learn more, read Configure an Application for Universal Portals.Exchange the refresh token for a session transfer token
Make this request immediately before you open the in-app browser. The token expires after 60 seconds and works once.access_token in the response is the session transfer token.
Open the in-app browser
Open the portal URL with the token:Hide portal navigation for in-app browsers
By default, a Portal shows a top bar, a sidebar, and a user menu. In an in-app browser, your Native Application already provides navigation and user context, so you can hide these elements with URL parameters:
The following wireframes show the result of each parameter and of common combinations:
The parameters persist while the user navigates between portal pages, so you add them once, when you open the in-app browser:
Open a Portal in an Organization context
Use theorganization parameter to open a Portal for a specific Organization. Always include it for business Portals, because the My Organization API needs an Organization to act on. Include it for consumer Portals when users belong to several Organizations.
Build the URL
Add the Organization to the portal URL:organization to the Auth0 /authorize endpoint, so use the same identifier format as your other /authorize requests: the Organization ID, such as org_abc123, or the Organization name when your tenant is set up to accept names. To learn more, read Use Organization Names in Authentication API.
Open the Portal from your application
Choose the Organization in your application, and then link to the URL. In a Native Application, addorganization to the URL that you open in the in-app browser. To learn more, read Open a Portal from a native application.
For a Native Application, the
organization value must match the Organization of the session transfer token. If they differ, Auth0 rejects the token and the user signs in again. To learn more, read Native to Web SSO with Organizations.Switch Organizations
When a user with an active portal session opens the Portal with a differentorganization, the Portal signs the user in again for that Organization and replaces the previous portal session.
What the Portal does in an Organization context
- Components that call the My Organization API act on the user’s Organization.
- The Portal applies that Organization’s branding.
- An MFA step-up challenge keeps the user in the same Organization.
Run an Action when users open a Portal
A Portal sign-in runs your post-login Actions. To run logic only for the Portal, compare the application’s Client ID withevent.client.client_id.
The following example restricts access to a business Portal and assumes you assign an admin role to your Organization administrators. Only users signed in with an Organization and with the admin role should be able to access the Portal:
URL parameters
Next steps
Configure an Application for Universal Portals
Set the application options that Native Applications and Organizations need.
Universal Portals Architecture
See how sign-in, component calls, and sessions work inside a Portal.
Troubleshoot Universal Portals
Fix sign-in and Organization problems.