Skip to main content
POST
/
authentication_providers
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const authenticationProvider = await client.authenticationProviders.create({
  name: 'Okta',
  settings: {
    idp_cert_fingerprint: '13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7',
    idp_entity_id: 'https://myorg.myidp.com/saml/metadata',
    idp_sso_target_url: 'https://myorg.myidp.com/trust/saml2/http-post/sso',
  },
  short_name: 'myorg',
});

console.log(authenticationProvider.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
authentication_provider = client.authentication_providers.create(
name="Okta",
settings={
"idp_cert_fingerprint": "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
"idp_entity_id": "https://myorg.myidp.com/saml/metadata",
"idp_sso_target_url": "https://myorg.myidp.com/trust/saml2/http-post/sso",
},
short_name="myorg",
)
print(authentication_provider.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
authenticationProvider, err := client.AuthenticationProviders.New(context.TODO(), telnyx.AuthenticationProviderNewParams{
Name: "Okta",
Settings: telnyx.SettingsParam{
IdpCertFingerprint: "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
IdpEntityID: "https://myorg.myidp.com/saml/metadata",
IdpSSOTargetURL: "https://myorg.myidp.com/trust/saml2/http-post/sso",
},
ShortName: "myorg",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", authenticationProvider.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.authenticationproviders.AuthenticationProviderCreateParams;
import com.telnyx.sdk.models.authenticationproviders.AuthenticationProviderCreateResponse;
import com.telnyx.sdk.models.authenticationproviders.Settings;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

AuthenticationProviderCreateParams params = AuthenticationProviderCreateParams.builder()
.name("Okta")
.settings(Settings.builder()
.idpCertFingerprint("13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7")
.idpEntityId("https://myorg.myidp.com/saml/metadata")
.idpSsoTargetUrl("https://myorg.myidp.com/trust/saml2/http-post/sso")
.build())
.shortName("myorg")
.build();
AuthenticationProviderCreateResponse authenticationProvider = client.authenticationProviders().create(params);
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

authentication_provider = telnyx.authentication_providers.create(
name: "Okta",
settings: {
idp_cert_fingerprint: "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
idp_entity_id: "https://myorg.myidp.com/saml/metadata",
idp_sso_target_url: "https://myorg.myidp.com/trust/saml2/http-post/sso"
},
short_name: "myorg"
)

puts(authentication_provider)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$authenticationProvider = $client->authenticationProviders->create(
name: 'Okta',
settings: [
'idpCertFingerprint' => '13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7',
'idpEntityID' => 'https://myorg.myidp.com/saml/metadata',
'idpSSOTargetURL' => 'https://myorg.myidp.com/trust/saml2/http-post/sso',
'idpCertFingerprintAlgorithm' => 'sha256',
],
shortName: 'myorg',
active: true,
settingsURL: 'https://myorg.myidp.com/saml/metadata',
);

var_dump($authenticationProvider);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx authentication-providers create \
--api-key 'My API Key' \
--name Okta \
--settings '{idp_cert_fingerprint: 13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7, idp_entity_id: https://myorg.myidp.com/saml/metadata, idp_sso_target_url: https://myorg.myidp.com/trust/saml2/http-post/sso}' \
--short-name myorg
curl --request POST \
--url https://api.telnyx.com/v2/authentication_providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Okta",
"short_name": "myorg",
"settings": {
"idp_entity_id": "https://myorg.myidp.com/saml/metadata",
"idp_sso_target_url": "https://myorg.myidp.com/trust/saml2/http-post/sso",
"idp_cert_fingerprint": "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
"idp_cert_fingerprint_algorithm": "sha256"
},
"active": true,
"settings_url": "https://myorg.myidp.com/saml/metadata"
}
'
{
  "data": {
    "id": "35146afd-df93-4963-b1e9-1a085e2ae874",
    "record_type": "authentication_provider",
    "name": "Okta",
    "short_name": "myorg",
    "organization_id": "24b4a4bb-c4df-46ad-bbcb-23fc741c5ad7",
    "active": true,
    "activated_at": "2018-02-02T22:25:27.521Z",
    "settings": {
      "assertion_consumer_service_url": "https://api.telnyx.com/sso/saml/auth/myorg",
      "service_provider_entity_id": "https://api.telnyx.com/sso/saml/metadata/myorg",
      "service_provider_login_url": "https://api.telnyx.com/sso/myorg",
      "idp_entity_id": "https://myorg.myidp.com/saml/metadata",
      "idp_sso_target_url": "https://myorg.myidp.com/trust/saml2/http-post/sso",
      "idp_cert_fingerprint": "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
      "idp_cert_fingerprint_algorithm": "sha256",
      "name_identifier_format": "urn:oasis:names:tc:SAML:1.1:nameid-format",
      "idp_slo_target_url": "https://myorg.myidp.com/trust/saml2/http-redirect/slo",
      "idp_certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
      "idp_attribute_names": {
        "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
      },
      "provision_groups": false
    },
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z"
  }
}
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The name associated with the authentication provider.

Example:

"Okta"

short_name
string
required

The short name associated with the authentication provider. This must be unique and URL-friendly, as it's going to be part of the login URL.

Example:

"myorg"

settings
object
required

The settings associated with the authentication provider.

active
boolean
default:true

The active status of the authentication provider

Example:

true

settings_url
string<uri>

The URL for the identity provider metadata file to populate the settings automatically. If the settings attribute is provided, that will be used instead.

Example:

"https://myorg.myidp.com/saml/metadata"

Response

Successful response

data
AuthenticationProvider · object