HTTPS Edge Route OAuth Module
Replace HTTPS Edge Route OAuth Module
Request
PUT /edges/https/{edge_id}/routes/{id}/oauth
Example Request
curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"enabled":true,"provider":{"google":{"client_id":"client-id","client_secret":"client-secret","scopes":["profile","email","https://www.googleapis.com/auth/userinfo.email"],"email_addresses":["alan@example.com"]}}}' \
https://api.ngrok.com/edges/https/edghts_2NTVHjLuHZCJWDtgT64kpynWPU9/routes/edghtsrt_2NTVHdygekEOQRR8dbUV9oNCLTH/oauth
Parameters
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
provider | EndpointOAuthProvider | an object which defines the identity provider to use for authentication and configuration for who may access the endpoint |
options_passthrough | boolean | Do not enforce authentication on HTTP OPTIONS requests. necessary if you are supporting CORS. |
cookie_prefix | string | the prefix of the session cookie that ngrok sets on the http client to cache authentication. default is 'ngrok.' |
inactivity_timeout | uint32 | Integer number of seconds of inactivity after which if the user has not accessed the endpoint, their session will time out and they will be forced to reauthenticate. |
maximum_duration | uint32 | Integer number of seconds of the maximum duration of an authenticated session. After this period is exceeded, a user must reauthenticate. |
auth_check_interval | uint32 | Integer number of seconds after which ngrok guarantees it will refresh user state from the identity provider and recheck whether the user is still authorized to access the endpoint. This is the preferred tunable to use to enforce a minimum amount of time after which a revoked user will no longer be able to access the resource. |
EndpointOAuthProvider parameters
github | EndpointOAuthGitHub | configuration for using github as the identity provider |
facebook | EndpointOAuthFacebook | configuration for using facebook as the identity provider |
microsoft | EndpointOAuthMicrosoft | configuration for using microsoft as the identity provider |
google | EndpointOAuthGoogle | configuration for using google as the identity provider |
linkedin | EndpointOAuthLinkedIn | configuration for using linkedin as the identity provider |
gitlab | EndpointOAuthGitLab | configuration for using gitlab as the identity provider |
EndpointOAuthGitHub parameters
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
teams | List<string> | a list of github teams identifiers. users will be allowed access to the endpoint if they are a member of any of these teams. identifiers should be in the 'slug' format qualified with the org name, e.g. org-name/team-name |
organizations | List<string> | a list of github org identifiers. users who are members of any of the listed organizations will be allowed access. identifiers should be the organization's 'slug' |
EndpointOAuthFacebook parameters
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthMicrosoft parameters
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthGoogle parameters
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthLinkedIn parameters
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
EndpointOAuthGitLab parameters
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"provider": {
"github": null,
"facebook": null,
"microsoft": null,
"google": {
"client_id": "client-id",
"client_secret": "client-secret",
"scopes": [
"profile",
"email",
"https://www.googleapis.com/auth/userinfo.email"
],
"email_addresses": [
"alan@example.com"
],
"email_domains": []
},
"linkedin": null,
"gitlab": null,
"twitch": null,
"amazon": null
},
"options_passthrough": false,
"cookie_prefix": "ngrok.",
"inactivity_timeout": 0,
"maximum_duration": 0,
"auth_check_interval": 0
}
Fields
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
provider | EndpointOAuthProvider | an object which defines the identity provider to use for authentication and configuration for who may access the endpoint |
options_passthrough | boolean | Do not enforce authentication on HTTP OPTIONS requests. necessary if you are supporting CORS. |
cookie_prefix | string | the prefix of the session cookie that ngrok sets on the http client to cache authentication. default is 'ngrok.' |
inactivity_timeout | uint32 | Integer number of seconds of inactivity after which if the user has not accessed the endpoint, their session will time out and they will be forced to reauthenticate. |
maximum_duration | uint32 | Integer number of seconds of the maximum duration of an authenticated session. After this period is exceeded, a user must reauthenticate. |
auth_check_interval | uint32 | Integer number of seconds after which ngrok guarantees it will refresh user state from the identity provider and recheck whether the user is still authorized to access the endpoint. This is the preferred tunable to use to enforce a minimum amount of time after which a revoked user will no longer be able to access the resource. |
EndpointOAuthProvider fields
github | EndpointOAuthGitHub | configuration for using github as the identity provider |
facebook | EndpointOAuthFacebook | configuration for using facebook as the identity provider |
microsoft | EndpointOAuthMicrosoft | configuration for using microsoft as the identity provider |
google | EndpointOAuthGoogle | configuration for using google as the identity provider |
linkedin | EndpointOAuthLinkedIn | configuration for using linkedin as the identity provider |
gitlab | EndpointOAuthGitLab | configuration for using gitlab as the identity provider |
EndpointOAuthGitHub fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
teams | List<string> | a list of github teams identifiers. users will be allowed access to the endpoint if they are a member of any of these teams. identifiers should be in the 'slug' format qualified with the org name, e.g. org-name/team-name |
organizations | List<string> | a list of github org identifiers. users who are members of any of the listed organizations will be allowed access. identifiers should be the organization's 'slug' |
EndpointOAuthFacebook fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthMicrosoft fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthGoogle fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthLinkedIn fields
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
EndpointOAuthGitLab fields
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
Get HTTPS Edge Route OAuth Module
Request
GET /edges/https/{edge_id}/routes/{id}/oauth
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/https/edghts_2NTVHjLuHZCJWDtgT64kpynWPU9/routes/edghtsrt_2NTVHdygekEOQRR8dbUV9oNCLTH/oauth
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"provider": {
"github": null,
"facebook": null,
"microsoft": null,
"google": {
"client_id": "client-id",
"client_secret": "client-secret",
"scopes": [
"profile",
"email",
"https://www.googleapis.com/auth/userinfo.email"
],
"email_addresses": [
"alan@example.com"
],
"email_domains": []
},
"linkedin": null,
"gitlab": null,
"twitch": null,
"amazon": null
},
"options_passthrough": false,
"cookie_prefix": "ngrok.",
"inactivity_timeout": 0,
"maximum_duration": 0,
"auth_check_interval": 0
}
Fields
enabled | boolean | true if the module will be applied to traffic, false to disable. default true if unspecified |
provider | EndpointOAuthProvider | an object which defines the identity provider to use for authentication and configuration for who may access the endpoint |
options_passthrough | boolean | Do not enforce authentication on HTTP OPTIONS requests. necessary if you are supporting CORS. |
cookie_prefix | string | the prefix of the session cookie that ngrok sets on the http client to cache authentication. default is 'ngrok.' |
inactivity_timeout | uint32 | Integer number of seconds of inactivity after which if the user has not accessed the endpoint, their session will time out and they will be forced to reauthenticate. |
maximum_duration | uint32 | Integer number of seconds of the maximum duration of an authenticated session. After this period is exceeded, a user must reauthenticate. |
auth_check_interval | uint32 | Integer number of seconds after which ngrok guarantees it will refresh user state from the identity provider and recheck whether the user is still authorized to access the endpoint. This is the preferred tunable to use to enforce a minimum amount of time after which a revoked user will no longer be able to access the resource. |
EndpointOAuthProvider fields
github | EndpointOAuthGitHub | configuration for using github as the identity provider |
facebook | EndpointOAuthFacebook | configuration for using facebook as the identity provider |
microsoft | EndpointOAuthMicrosoft | configuration for using microsoft as the identity provider |
google | EndpointOAuthGoogle | configuration for using google as the identity provider |
linkedin | EndpointOAuthLinkedIn | configuration for using linkedin as the identity provider |
gitlab | EndpointOAuthGitLab | configuration for using gitlab as the identity provider |
EndpointOAuthGitHub fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
teams | List<string> | a list of github teams identifiers. users will be allowed access to the endpoint if they are a member of any of these teams. identifiers should be in the 'slug' format qualified with the org name, e.g. org-name/team-name |
organizations | List<string> | a list of github org identifiers. users who are members of any of the listed organizations will be allowed access. identifiers should be the organization's 'slug' |
EndpointOAuthFacebook fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthMicrosoft fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthGoogle fields
client_id | string | the OAuth app client ID. retrieve it from the identity provider's dashboard where you created your own OAuth app. optional. if unspecified, ngrok will use its own managed oauth application which has additional restrictions. see the OAuth module docs for more details. if present, client_secret must be present as well. |
client_secret | string | the OAuth app client secret. retrieve if from the identity provider's dashboard where you created your own OAuth app. optional, see all of the caveats in the docs for client_id . |
scopes | List<string> | a list of provider-specific OAuth scopes with the permissions your OAuth app would like to ask for. these may not be set if you are using the ngrok-managed oauth app (i.e. you must pass both client_id and client_secret to set scopes) |
email_addresses | List<string> | a list of email addresses of users authenticated by identity provider who are allowed access to the endpoint |
email_domains | List<string> | a list of email domains of users authenticated by identity provider who are allowed access to the endpoint |
EndpointOAuthLinkedIn fields
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
EndpointOAuthGitLab fields
client_id | string | |
client_secret | string | |
scopes | List<string> | |
email_addresses | List<string> | |
email_domains | List<string> |
Delete HTTPS Edge Route OAuth Module
Request
DELETE /edges/https/{edge_id}/routes/{id}/oauth
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/https/edghts_2NTVHjLuHZCJWDtgT64kpynWPU9/routes/edghtsrt_2NTVHdygekEOQRR8dbUV9oNCLTH/oauth
Response
Returns a 204 response with no body on success