---
title: Authenticate via an external SSO provider
slug: docs/demo/authenticate-via-an-external-sso-provider
description: Learn how to effectively execute a cURL command for sending a POST request to a simulated API in this comprehensive document. Gain insights into the inclusion of crucial headers and a JSON payload containing pivotal parameters like redirect URI, provider,
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "-YbKHRZ-rOisreUg2hUcc",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/authenticate/external-providers",
    "name": "Authenticate via an external SSO provider",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "authenticaticationParameters",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "redirectURI",
              "type": "string",
              "example": "",
              "description": "RedirectURI"
            },
            {
              "kind": "optional",
              "name": "provider",
              "type": "string<Google | Facebook | yahoo-jp | Janrain>",
              "example": "",
              "description": "The SSO provider"
            },
            {
              "kind": "optional",
              "name": "locale",
              "type": "string",
              "example": "",
              "description": "The code for the language you want to use for the login experience."
            },
            {
              "kind": "optional",
              "name": "authorisationCode",
              "type": "string",
              "example": "",
              "description": "Authorisation Code"
            },
            {
              "kind": "optional",
              "name": "accessToken",
              "type": "string",
              "example": "",
              "description": "Access Token"
            },
            {
              "kind": "optional",
              "name": "applicationIdentifier",
              "type": "string",
              "example": "",
              "description": "Application Identifier"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AuthenticateByExternalProvider",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AuthenticateByExternalProvider",
          "isExpanded": true,
          "description": "Authenticate by an external provider."
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "status",
                "type": "string<NotSet | TokenExchangeFault | ProfileRetrieveFault | GeneralFault | NoAccountMatch | InactiveAccountMatch | UnLinkedAccountMatch | LinkedAccountMatch | ExistingLinkFault | NewLink | PermissionFault>",
                "example": "",
                "description": "The status of the session."
              },
              {
                "kind": "optional",
                "name": "sessionToken",
                "type": "string",
                "example": "",
                "description": "The third-party session token."
              },
              {
                "kind": "optional",
                "name": "refreshToken",
                "type": "string",
                "example": "",
                "description": "The Google Play refresh token."
              },
              {
                "kind": "optional",
                "name": "providerProfileDetails",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Account reference"
                  },
                  {
                    "kind": "optional",
                    "name": "firstName",
                    "type": "string",
                    "example": "",
                    "description": "The first name of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "surname",
                    "type": "string",
                    "example": "",
                    "description": "The surname of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "emailAddress",
                    "type": "string",
                    "example": "",
                    "description": "The email address of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "gender",
                    "type": "string<NotKnown | Female | Male>",
                    "example": "",
                    "description": "The gender of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "mobilePhone",
                    "type": "string",
                    "example": "",
                    "description": "The mobile phone of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "phone",
                    "type": "string",
                    "example": "",
                    "description": "The phone of the user."
                  },
                  {
                    "kind": "optional",
                    "name": "address",
                    "type": "object",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "houseName",
                        "type": "string",
                        "example": "",
                        "description": "House name"
                      },
                      {
                        "kind": "optional",
                        "name": "houseNumber",
                        "type": "string",
                        "example": "",
                        "description": "House number"
                      },
                      {
                        "kind": "optional",
                        "name": "street",
                        "type": "string",
                        "example": "",
                        "description": "Street name"
                      },
                      {
                        "kind": "optional",
                        "name": "townCity",
                        "type": "string",
                        "example": "",
                        "description": "Name of town city"
                      },
                      {
                        "kind": "optional",
                        "name": "district",
                        "type": "string",
                        "example": "",
                        "description": "Name of district"
                      },
                      {
                        "kind": "optional",
                        "name": "state",
                        "type": "string",
                        "example": "",
                        "description": "State"
                      },
                      {
                        "kind": "optional",
                        "name": "county",
                        "type": "string",
                        "example": "",
                        "description": "County"
                      },
                      {
                        "kind": "optional",
                        "name": "postCode",
                        "type": "string",
                        "example": "",
                        "description": "Post code"
                      },
                      {
                        "kind": "optional",
                        "name": "country",
                        "type": "string",
                        "example": "",
                        "description": "Country"
                      },
                      {
                        "kind": "optional",
                        "name": "isDefault",
                        "type": "boolean",
                        "example": "",
                        "description": "Is default"
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AddressBase",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AddressBase",
                    "description": "The address of the user."
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.ProviderProfileDetails",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.ProviderProfileDetails",
                "description": "The user profile details."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.ThirdPartyLoginDetails",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.ThirdPartyLoginDetails",
            "isExpanded": true,
            "description": "Third-party login details."
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"status\": \"NoAccountMatch\",\n  \"sessionToken\": \"6640ffaf3z954fdf8ba4342b51265e05\",\n  \"providerProfileDetails\": {\n    \"accountReference\": \"AccountReference\",\n    \"firstName\": \"Joe\",\n    \"surname\": \"Smith\",\n    \"emailAddress\": \"developers@eSuite.com\",\n    \"gender\": \"NotKnown\",\n    \"address\": {\n      \"houseName\": \"HouseName\",\n      \"houseNumber\": \"HouseNumber\",\n      \"street\": \"Street\",\n      \"townCity\": \"TownCity\",\n      \"district\": \"District\",\n      \"state\": \"State\",\n      \"county\": \"County\",\n      \"postCode\": \"PostCode\",\n      \"country\": \"Country\"\n    }\n  }\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will allow a customer to authenticate themselves against a specific SSO provider. \r\n            If the authentication is successful, eSuite will indicate whether the account should be linked to an existing account or registered  in eSuite.",
    "examples": {
      "languages": [
        {
          "id": "1H7aVKBNRl31jcT7KAgda",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/authenticate/external-providers \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "SEHGCkntE0leic7klNrVH",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/authenticate/external-providers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Hz9DjETFBXO6r_toHhqiJ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/authenticate/external-providers\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "vEblHTGQN43GeSrTz6yZJ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/authenticate/external-providers\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "1H7aVKBNRl31jcT7KAgda"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"status\": \"NoAccountMatch\",\n  \"sessionToken\": \"6640ffaf3z954fdf8ba4342b51265e05\",\n  \"providerProfileDetails\": {\n    \"accountReference\": \"AccountReference\",\n    \"firstName\": \"Joe\",\n    \"surname\": \"Smith\",\n    \"emailAddress\": \"developers@eSuite.com\",\n    \"gender\": \"NotKnown\",\n    \"address\": {\n      \"houseName\": \"HouseName\",\n      \"houseNumber\": \"HouseNumber\",\n      \"street\": \"Street\",\n      \"townCity\": \"TownCity\",\n      \"district\": \"District\",\n      \"state\": \"State\",\n      \"county\": \"County\",\n      \"postCode\": \"PostCode\",\n      \"country\": \"Country\"\n    }\n  }\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not Found\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}