This guide refers to using SSO to authenticate access to your endpoints. You cannot use these instructions to set up SSO for logging into your ngrok account in the dashboard.
- Restrict access to ngrok endpoints only to users authenticated via Frontegg
- Use Frontegg security policies and MFA authenticators
- Use Frontegg’s Dashboard to facilitate access to ngrok apps
What you’ll need
- A Frontegg account with administrative rights to create apps.
- An ngrok Pay-as-you-go account with an authtoken or admin access to configure endpoints with SAML.
1. Download the IDP metadata
- Access the Frontegg Portal and sign in using your Frontegg administrator account.
- On the left menu, click your environment under Environments and then click Env settings.
- On the General Settings page, copy both the Client ID and API Key values.
-
Open a terminal window and run the following command to get an access token:
Replace the following with values:
- CLIENT_ID: The client ID value you copied before.
- API_KEY: The API key value you copied before.
- Copy the value of the token attribute from the response.
-
In the same terminal window, run the following command to download the metadata XML file from Frontegg:
Replace the following with values copied on previous steps:
- YOUR_FRONTEGG_HOST_URL: The value of the Domain name from the Env settings > Domains tab.
- TOKEN: The token you copied before.
-
Copy the response and save it as the
idp_metadata.xmlfile locally on your desktop. The response starts with<EntityDescriptorand ends with</EntityDescriptor>. Anything different may be an error.
2. Configure ngrok
Once you have developer preview access, create apolicy.yaml file with the following content, replacing YOUR_IDP_METADATA_XML with the IdP metadata XML from Frontegg:
3. Configure Frontegg
-
In the same terminal window in which you ran the previous commands, run the following command to create a SAML configuration related to your ngrok SAML endpoint:
Replace the following with the values copied on previous steps:
- URL-ENCODED-NGROK-ENTITY-ID: URL-Encoded value of the ngrok Entity ID retrieved from the SAML action (see the SAML action documentation for how to retrieve these values).
- YOUR_FRONTEGG_HOST_URL: The value of the Domain name from the Env settings > Domains tab.
- TOKEN: The Frontegg token you copied before.
- NGROK_ACS_URL: The value of the ngrok ACS URL retrieved from the SAML action developer preview docs.
- NGROK_ENTITY_ID_URL: The value of the ngrok Entity ID retrieved from the SAML action developer preview docs.
4. Update Frontegg login method
- Access the Frontegg Portal and sign in using your Frontegg administrator account.
- On the left menu, click your environment under Environments, click Authentication, and then click Login method.
- On the Select your login method page, make sure Hosted login is selected, and click Add new twice.
- In the first empty field, enter your ngrok forwarding URL (for example,
https://123456789.ngrok.app/). In the second field, enter the ACS URL retrieved from the SAML action (see the SAML action documentation). - Click Save.
5. Start a tunnel
This step assumes you have an app running locally (for example, on
localhost:3000) with the ngrok client installed.3000 with your local web app port and YOUR_DOMAIN with your ngrok domain:
Grant access to Frontegg users
Create a Frontegg user:- On the left menu of the Frontegg Portal, click your environment, click Backoffice, click Accounts, and then click Add New.
- On the Add new account popup, enter a name for the account,
ngrok.comin the Domain field, and then click Save. - On the left menu, click Backoffice, click Users, and then click Add New.
- On the Add new user popup, enter a name and email, select the account you have created, and then click Save. By default, the user is assigned the Admin role.
Test the integration
- In your browser, launch an incognito window.
- Access your ngrok tunnel (for example,
https://frontegg-sso-test.ngrok.appor using the copied endpoint URL). - You should be prompted to log in with your Frontegg credentials.
- After logging in, you should be able to see your web app.