Amazon OAuth
Configure Login with Amazon
The step-by-step instructions below follow Amazon's documentation on Register for Login with Amazon for websites.
Create a Security Profile for ngrok
-
Navigate to the Login with Amazon portal, and sign in with your Amazon Developer credentials.
noteIf you don't have a developer account, you'll need to sign up for a new one.
-
Click Create a New Security Profile, provide a Name and a Description for your security profile, enter the privacy URL provided by your application (i.e.
https://ngrok.com/privacy
) in the Consent Privacy Notice URL, and then click Save. -
Click Show Client ID and Client Secret to reveal your Client ID and Client Secret values and make a note of both of them.
-
Hover over the gear icon of the Security Profile you created and then click Web Settings.
-
On the Security Profile page, click Edit, enter
https://idp.ngrok.com/oauth2/callback
in the Allowed Return URLs field, and then click Save.
Update your ngrok endpoint traffic policy
- Access the ngrok Dashboard Endpoints page and locate an existing endpoint you'd like to add this to or create a new one.
- In your traffic policy, add the following configuration:
- YAML
- JSON
---
on_http_request:
- actions:
- type: oauth
config:
provider: amazon
client_id: "{your app's oauth client id}"
client_secret: "{your app's oauth client secret}"
scopes:
- profile
{
"on_http_request": [
{
"actions": [
{
"type": "oauth",
"config": {
"provider": "amazon",
"client_id": "{your app's oauth client id}",
"client_secret": "{your app's oauth client secret}",
"scopes": [
"profile"
]
}
}
]
}
]
}
You may add any scopes that are required by your application with the following caveats.
- Scopes which require a Facebook app review are unsupported.
- ngrok will enforce that users accept all permissions before completing authorization.
- Click Save to validate and update your traffic policy.
Configure access control
Optionally, configure access control to your service by only allowing specific users or domains. For example:
- YAML
- JSON
# Only allow access to me@example.com. Add this after your OAuth Action.
---
on_http_request:
- expressions:
- "!(actions.ngrok.oauth.identity.email in ['me@example.com'])"
actions:
- type: deny
// Only allow access to me@example.com. Add this after your OAuth Action.
{
"on_http_request": [
{
"expressions": [
"!(actions.ngrok.oauth.identity.email in ['me@example.com'])"
],
"actions": [
{
"type": "deny"
}
]
}
]
}