curl --request PUT \
--url https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'ngrok-version: <ngrok-version>' \
--data '
{
"edge_id": "<string>",
"id": "<string>",
"module": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"nameid_format": "<string>"
}
}
'import requests
url = "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml"
payload = {
"edge_id": "<string>",
"id": "<string>",
"module": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": True,
"allow_idp_initiated": True,
"authorized_groups": ["<string>"],
"nameid_format": "<string>"
}
}
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'ngrok-version': '<ngrok-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_id: '<string>',
id: '<string>',
module: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
idp_metadata: '<string>',
force_authn: true,
allow_idp_initiated: true,
authorized_groups: ['<string>'],
nameid_format: '<string>'
}
})
};
fetch('https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'edge_id' => '<string>',
'id' => '<string>',
'module' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'idp_metadata' => '<string>',
'force_authn' => true,
'allow_idp_initiated' => true,
'authorized_groups' => [
'<string>'
],
'nameid_format' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml"
payload := strings.NewReader("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"entity_id": "<string>",
"assertion_consumer_service_url": "<string>",
"single_logout_url": "<string>",
"request_signing_certificate_pem": "<string>",
"metadata_url": "<string>",
"nameid_format": "<string>"
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}Replace
curl --request PUT \
--url https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'ngrok-version: <ngrok-version>' \
--data '
{
"edge_id": "<string>",
"id": "<string>",
"module": {
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"nameid_format": "<string>"
}
}
'import requests
url = "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml"
payload = {
"edge_id": "<string>",
"id": "<string>",
"module": {
"enabled": True,
"options_passthrough": True,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": True,
"allow_idp_initiated": True,
"authorized_groups": ["<string>"],
"nameid_format": "<string>"
}
}
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'ngrok-version': '<ngrok-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_id: '<string>',
id: '<string>',
module: {
enabled: true,
options_passthrough: true,
cookie_prefix: '<string>',
inactivity_timeout: 123,
maximum_duration: 123,
idp_metadata: '<string>',
force_authn: true,
allow_idp_initiated: true,
authorized_groups: ['<string>'],
nameid_format: '<string>'
}
})
};
fetch('https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'edge_id' => '<string>',
'id' => '<string>',
'module' => [
'enabled' => true,
'options_passthrough' => true,
'cookie_prefix' => '<string>',
'inactivity_timeout' => 123,
'maximum_duration' => 123,
'idp_metadata' => '<string>',
'force_authn' => true,
'allow_idp_initiated' => true,
'authorized_groups' => [
'<string>'
],
'nameid_format' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml"
payload := strings.NewReader("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/edges/https/{edge_id}/routes/{id}/saml")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edge_id\": \"<string>\",\n \"id\": \"<string>\",\n \"module\": {\n \"enabled\": true,\n \"options_passthrough\": true,\n \"cookie_prefix\": \"<string>\",\n \"inactivity_timeout\": 123,\n \"maximum_duration\": 123,\n \"idp_metadata\": \"<string>\",\n \"force_authn\": true,\n \"allow_idp_initiated\": true,\n \"authorized_groups\": [\n \"<string>\"\n ],\n \"nameid_format\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"options_passthrough": true,
"cookie_prefix": "<string>",
"inactivity_timeout": 123,
"maximum_duration": 123,
"idp_metadata": "<string>",
"force_authn": true,
"allow_idp_initiated": true,
"authorized_groups": [
"<string>"
],
"entity_id": "<string>",
"assertion_consumer_service_url": "<string>",
"single_logout_url": "<string>",
"request_signing_certificate_pem": "<string>",
"metadata_url": "<string>",
"nameid_format": "<string>"
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}Authorizations
Response
n/a
If true, the IdP may initiate a login directly (for example, the user does not need to visit the endpoint first and then be redirected). The IdP should set the RelayState parameter to the target URL of the resource they want the user to be redirected to after the SAML login assertion has been processed.
PEM-encoded x.509 certificate of the key pair that is used to sign all SAML requests that the ngrok SP makes to the IdP. Many IdPs do not support request signing verification, but ngrok highly recommends specifying this in the IdP's configuration if it is supported.
Defines the name identifier format the SP expects the IdP to use in its assertions to identify subjects. If unspecified, a default value of urn:oasis:names:tc:SAML:2.0:nameid-format:persistent will be used. A subset of the allowed values enumerated by the SAML specification are supported.
Was this page helpful?