# Create an OpenID Connect

Endpoint: POST /openidconnects
Version: 1.0.450.36533
Security: OAuth2

## Request fields (application/json):

  - `OrderCloudApiClientID` (string, required)
    An ID that references an OrderCloud API Client.

  - `ConnectClientID` (string, required)
    An app ID from the Identity Provider that is required to get JWT tokens.

  - `ConnectClientSecret` (string, required)
    A secret string from the Identity Provider that grants access to get JWT tokens.

  - `AppStartUrl` (string, required)
    A URL on your front-end ordering site where users will be redirected after they authenticate through the Identity Provider. Supports placeholders: {0} = OrderCloud access token, {1} = IdP access token, {2} = appStartPath, {3} = OrderCloud refresh token, {4} = IdP refresh token (if available).

  - `AuthorizationEndpoint` (string, required)
    A publicly known URL from the Identity Provider that redirects to a resource where users enter personal credentials.

  - `TokenEndpoint` (string, required)
    A publicly known URL from the Identity Provider where agents can get JWT tokens.

  - `ID` (string)
    ID of this OpenID Connect configuration object. Each object allows authentication to one OrderCloud API Client through one Identity Providing Party.

  - `UrlEncoded` (boolean)
    If true, uses a url encoded form post with all auth values. Otherwise, an Authorization header with basic auth is passed with a JSON object in the body.

  - `IntegrationEventID` (string)
    ID of the integration event to call upon authorization request. Used when you haven't pre-populated users into OrderCloud, or need to sync user data.

  - `CallSyncUserIntegrationEvent` (boolean)
    If true, the integration event is always triggered regardless of if the user already exists in OrderCloud.

  - `AdditionalIdpScopes` (array)
    Any additional scopes needed by the IDP.
    Example: [""]

  - `CustomErrorUrl` (string)
    A URL on your front-end ordering site where users will be redirected if an error occurs while trying to authenticate.

## Response 201 fields (application/json):

  - `ID` (string)
    ID of this OpenID Connect configuration object. Each object allows authentication to one OrderCloud API Client through one Identity Providing Party.

  - `OrderCloudApiClientID` (string)
    An ID that references an OrderCloud API Client.

  - `ConnectClientID` (string)
    An app ID from the Identity Provider that is required to get JWT tokens.

  - `ConnectClientSecret` (string)
    A secret string from the Identity Provider that grants access to get JWT tokens.

  - `AppStartUrl` (string)
    A URL on your front-end ordering site where users will be redirected after they authenticate through the Identity Provider. Supports placeholders: {0} = OrderCloud access token, {1} = IdP access token, {2} = appStartPath, {3} = OrderCloud refresh token, {4} = IdP refresh token (if available).

  - `AuthorizationEndpoint` (string)
    A publicly known URL from the Identity Provider that redirects to a resource where users enter personal credentials.

  - `TokenEndpoint` (string)
    A publicly known URL from the Identity Provider where agents can get JWT tokens.

  - `UrlEncoded` (boolean)
    If true, uses a url encoded form post with all auth values. Otherwise, an Authorization header with basic auth is passed with a JSON object in the body.

  - `IntegrationEventID` (string)
    ID of the integration event to call upon authorization request. Used when you haven't pre-populated users into OrderCloud, or need to sync user data.

  - `CallSyncUserIntegrationEvent` (boolean)
    If true, the integration event is always triggered regardless of if the user already exists in OrderCloud.

  - `IntegrationEventName` (string)

  - `AdditionalIdpScopes` (array)
    Any additional scopes needed by the IDP.
    Example: [""]

  - `CustomErrorUrl` (string)
    A URL on your front-end ordering site where users will be redirected if an error occurs while trying to authenticate.

## Response 4XX fields (application/json):

  - `StatusCode` (integer)
    Example: "404"

  - `ErrorCode` (string)
    Example: "NotFoundError"

  - `Message` (string)
    Example: "Object not found"

  - `Data` (object)
    Example: {"ObjectType":"","ObjectID":""}


