> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creates an authentication provider

> Creates an authentication provider.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/authentication-providers.yml post /authentication_providers
openapi: 3.1.0
info:
  title: Telnyx Authentication Providers API
  version: 2.0.0
  description: API for Authentication providers.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /authentication_providers:
    post:
      tags:
        - Authentication Providers
      summary: Creates an authentication provider
      description: Creates an authentication provider.
      operationId: CreateAuthenticationProvider
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticationProviderCreate'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AuthenticationProvider'
        '422':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: {}
      deprecated: false
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tauthenticationProvider, err := client.AuthenticationProviders.New(context.TODO(), telnyx.AuthenticationProviderNewParams{\n\t\tName: \"Okta\",\n\t\tSettings: telnyx.SettingsParam{\n\t\t\tIdpCertFingerprint: \"13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7\",\n\t\t\tIdpEntityID:        \"https://myorg.myidp.com/saml/metadata\",\n\t\t\tIdpSSOTargetURL:    \"https://myorg.myidp.com/trust/saml2/http-post/sso\",\n\t\t},\n\t\tShortName: \"myorg\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", authenticationProvider.Data)\n}\n"
        - lang: Java
          source: >-
            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);
                }
            }
        - lang: Ruby
          source: |-
            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)
        - lang: CLI
          source: |-
            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
components:
  schemas:
    AuthenticationProviderCreate:
      type: object
      required:
        - name
        - short_name
        - settings
      properties:
        name:
          $ref: '#/components/schemas/name'
        short_name:
          $ref: '#/components/schemas/short_name'
        active:
          $ref: '#/components/schemas/active'
        settings:
          $ref: '#/components/schemas/settings'
        settings_url:
          $ref: '#/components/schemas/settings_url'
    AuthenticationProvider:
      type: object
      title: AuthenticationProvider
      properties:
        id:
          type: string
          format: uuid
          description: Uniquely identifies the authentication provider.
          example: 35146afd-df93-4963-b1e9-1a085e2ae874
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: authentication_provider
        name:
          $ref: '#/components/schemas/name'
        short_name:
          $ref: '#/components/schemas/short_name'
        organization_id:
          $ref: '#/components/schemas/organization_id'
        active:
          $ref: '#/components/schemas/active'
        activated_at:
          type: string
          description: >-
            ISO 8601 formatted date indicating when the authentication provider
            was activated.
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        settings:
          type: object
          description: The settings associated with the authentication provider.
          properties:
            assertion_consumer_service_url:
              type: string
              description: >-
                The Assertion Consumer Service URL for the service provider
                (Telnyx).
              format: uri
              example: https://api.telnyx.com/sso/saml/auth/myorg
            service_provider_entity_id:
              type: string
              description: The Entity ID for the service provider (Telnyx).
              format: uri
              example: https://api.telnyx.com/sso/saml/metadata/myorg
            service_provider_login_url:
              type: string
              description: >-
                The login URL for the service provider (Telnyx). Users navigate
                to this URL to initiate SSO login.
              format: uri
              example: https://api.telnyx.com/sso/myorg
            idp_entity_id:
              type: string
              description: The Entity ID for the identity provider (IdP).
              format: uri
              example: https://myorg.myidp.com/saml/metadata
            idp_sso_target_url:
              type: string
              description: The SSO target url for the identity provider (IdP).
              format: uri
              example: https://myorg.myidp.com/trust/saml2/http-post/sso
            idp_cert_fingerprint:
              type: string
              description: The certificate fingerprint for the identity provider (IdP)
              example: 13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7
            idp_cert_fingerprint_algorithm:
              type: string
              description: >-
                The algorithm used to generate the identity provider's (IdP)
                certificate fingerprint
              enum:
                - sha1
                - sha256
                - sha384
                - sha512
              default: sha1
              example: sha256
            name_identifier_format:
              type: string
              description: >-
                The name identifier format associated with the authentication
                provider. This must be the same for both the Identity Provider
                (IdP) and the service provider (Telnyx).
              example: urn:oasis:names:tc:SAML:1.1:nameid-format
            idp_slo_target_url:
              type: string
              description: >-
                The Single Logout (SLO) target URL for the identity provider
                (IdP).
              format: uri
              example: https://myorg.myidp.com/trust/saml2/http-redirect/slo
            idp_certificate:
              type: string
              description: The full X.509 certificate for the identity provider (IdP).
              example: |-
                -----BEGIN CERTIFICATE-----
                MIIC...
                -----END CERTIFICATE-----
            idp_attribute_names:
              type: object
              description: >-
                Mapping of SAML attribute names used by the identity provider
                (IdP).
              example:
                email: >-
                  http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
            provision_groups:
              type: boolean
              description: >-
                Whether group provisioning is enabled for this authentication
                provider.
              example: false
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          format: date-time
          example: '2018-02-02T22:25:27.521Z'
    name:
      type: string
      description: The name associated with the authentication provider.
      example: Okta
    short_name:
      type: string
      description: >-
        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
    active:
      type: boolean
      description: The active status of the authentication provider
      default: true
      example: true
    settings:
      type: object
      description: The settings associated with the authentication provider.
      required:
        - idp_entity_id
        - idp_sso_target_url
        - idp_cert_fingerprint
      properties:
        idp_entity_id:
          type: string
          description: The Entity ID for the identity provider (IdP).
          format: uri
          example: https://myorg.myidp.com/saml/metadata
        idp_sso_target_url:
          type: string
          description: The SSO target url for the identity provider (IdP).
          format: uri
          example: https://myorg.myidp.com/trust/saml2/http-post/sso
        idp_cert_fingerprint:
          type: string
          description: The certificate fingerprint for the identity provider (IdP)
          example: 13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7
        idp_cert_fingerprint_algorithm:
          type: string
          description: >-
            The algorithm used to generate the identity provider's (IdP)
            certificate fingerprint
          enum:
            - sha1
            - sha256
            - sha384
            - sha512
          default: sha1
          example: sha256
    settings_url:
      type: string
      description: >-
        The URL for the identity provider metadata file to populate the settings
        automatically. If the settings attribute is provided, that will be used
        instead.
      format: uri
      example: https://myorg.myidp.com/saml/metadata
    organization_id:
      type: string
      format: uuid
      description: The id from the Organization the authentication provider belongs to.
      example: 24b4a4bb-c4df-46ad-bbcb-23fc741c5ad7
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````