# Create Federation user source

Create a new federation user source.

A valid environment token is required to call this endpoint.

Endpoint: POST /resources/user-sources/v1/federation
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `name` (string, required)
    The user source name

  - `configuration` (object, required)
    User source configuration

  - `configuration.syncOnLogin` (boolean, required)
    Whether to sync user profile attributes on each login

  - `configuration.wellknownUrl` (string)
    The url of the service provider

  - `configuration.oauth2Config` (object)
    OAuth2 configuration (required if wellknownUrl is not provided)

  - `configuration.oauth2Config.authorizationUrl` (string, required)
    The authorization URL of the OAuth2 provider

  - `configuration.oauth2Config.tokenUrl` (string, required)
    The token URL of the OAuth2 provider

  - `configuration.oauth2Config.userInfoUrl` (string, required)
    The user info URL of the OAuth2 provider

  - `configuration.oauth2Config.scopes` (array)
    The scopes to request from the OAuth2 provider
    Example: ["openid","email","profile"]

  - `configuration.oauth2Config.grantTypes` (array)
    The OAuth2 grant types
    Example: ["authorization_code"]

  - `configuration.oauth2Config.codeChallengeMethods` (array)
    The PKCE code challenge methods
    Example: ["S256"]

  - `configuration.clientId` (string, required)
    The client id from the service provider

  - `configuration.secret` (string)
    The secret from the service provider

  - `configuration.usePkce` (boolean)
    Whether to use PKCE

  - `configuration.tenantConfig` (any, required)

  - `configuration.tenantConfig.tenantIdFieldName` (string, required)
    The attribute name of which the tenant id would be taken from

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "dynamic"

  - `configuration.tenantConfig.tenantId` (string, required)
    The tenant id which all of the users would be added to

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "static"

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "new"

  - `appIds` (array)
    The application Ids to assign to this user source

  - `index` (number, required)
    The user source index

  - `description` (string)
    The user source description

## Response 201 fields (application/json):

  - `id` (string, required)

  - `name` (string, required)

  - `type` (string, required)

  - `appIds` (array, required)

  - `description` (string, required)

  - `index` (number, required)

