> This page is for Multi-Tenant, version v3.0 (default).
> For other versions, use one of these documentation indexes:
> - v3.0 (default): https://docs.nvidia.com/run-ai/multi-tenant/v3.0/llms.txt
> - v2.26: https://docs.nvidia.com/run-ai/multi-tenant/v2.26/llms.txt
> - v2.25: https://docs.nvidia.com/run-ai/multi-tenant/v2.25/llms.txt
> - v2.24: https://docs.nvidia.com/run-ai/multi-tenant/v2.24/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/run-ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/run-ai/_mcp/server.

# Configure external idp

POST http://localhost:8080/api/v1/idps
Content-Type: application/json

Reference: https://docs.nvidia.com/run-ai/multi-tenant/reference/rest-api/endpoints/authentication-and-authorization/idps/create-idp

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication

## Request

### Query parameters

- `tenantId` (string, optional, default: ) — If exists will return the relevant resource for the tenant ID

### Body (application/json)

This endpoint expects an IdpCreationRequest.

- `type` (enum, required)
  - Allowed values: `oidc`, `saml`, `openshift-v4`
- `name` (string, optional)
- `samlData` (SamlCreationData, optional)
- `oidcData` (OidcCreationData, optional)
- `ocpData` (OcpCreationData, optional)
- `mappers` (Mappers, optional)

## Response

### 201

Executed successfully.

- `alias` (string, required)

## Errors

### 400 Bad Request Error

Bad request.

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 403 Forbidden Error

Forbidden

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 404 Not Found Error

The specified resource was not found

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 409 Conflict Error

The specified resource already exists

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 500 Internal Server Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 503 Service Unavailable Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

## Types

### SamlCreationData

- `metadataXmlUrl` (string, optional)
- `metadataXmlFile` (string, optional)
- `fileName` (string, optional)
- `metadataXmlType` (enum, optional)
  - Allowed values: `url`, `file`
- `entityId` (string, optional)

### OidcCreationData

- `clientId` (string, required)
- `clientSecret` (string, required)
- `discoverDocumentUrl` (string, required)
- `scopes` (list of string, optional)
- `mandatoryClaim` (MandatoryClaim, optional)

### OcpCreationData

- `idpBaseUrl` (string, required)
- `clientSecret` (string, required)
- `clientId` (string, optional)
- `scopes` (list of string, optional)

### Mappers

- `gid` (string, optional)
- `uid` (string, optional)
- `groups` (string, optional)
- `supplementaryGroups` (string, optional)
- `email` (string, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)

### MandatoryClaim

- `claim` (string, required)
- `values` (list of string, required)

## Examples

### saml (by url)

**Request**

```json
{
  "type": "saml",
  "samlData": {
    "metadataXmlUrl": "https://authhost/saml/metadata.xml",
    "metadataXmlType": "url"
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}
```

**Response**

```json
{
  "alias": "oidc"
}
```

**SDK Code**

```python saml (by url)
import requests

url = "http://localhost:8080/api/v1/idps"

querystring = {"tenantId":"1008"}

payload = {
    "type": "saml",
    "samlData": {
        "metadataXmlUrl": "https://authhost/saml/metadata.xml",
        "metadataXmlType": "url"
    },
    "mappers": {
        "gid": "GID",
        "uid": "UID",
        "groups": "GROUPS",
        "supplementaryGroups": "SUPPLEMENTARYGROUPS",
        "email": "email"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript saml (by url)
const url = 'http://localhost:8080/api/v1/idps?tenantId=1008';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"saml","samlData":{"metadataXmlUrl":"https://authhost/saml/metadata.xml","metadataXmlType":"url"},"mappers":{"gid":"GID","uid":"UID","groups":"GROUPS","supplementaryGroups":"SUPPLEMENTARYGROUPS","email":"email"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go saml (by url)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/idps?tenantId=1008"

	payload := strings.NewReader("{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlUrl\": \"https://authhost/saml/metadata.xml\",\n    \"metadataXmlType\": \"url\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby saml (by url)
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/idps?tenantId=1008")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlUrl\": \"https://authhost/saml/metadata.xml\",\n    \"metadataXmlType\": \"url\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java saml (by url)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/idps?tenantId=1008")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlUrl\": \"https://authhost/saml/metadata.xml\",\n    \"metadataXmlType\": \"url\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")
  .asString();
```

```php saml (by url)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/idps?tenantId=1008', [
  'body' => '{
  "type": "saml",
  "samlData": {
    "metadataXmlUrl": "https://authhost/saml/metadata.xml",
    "metadataXmlType": "url"
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp saml (by url)
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/idps?tenantId=1008");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlUrl\": \"https://authhost/saml/metadata.xml\",\n    \"metadataXmlType\": \"url\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift saml (by url)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "saml",
  "samlData": [
    "metadataXmlUrl": "https://authhost/saml/metadata.xml",
    "metadataXmlType": "url"
  ],
  "mappers": [
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/idps?tenantId=1008")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### saml (by file)

**Request**

```json
{
  "type": "saml",
  "samlData": {
    "metadataXmlFile": "<file content in base64>",
    "fileName": "descriptor.xml",
    "metadataXmlType": "file"
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}
```

**Response**

```json
{
  "alias": "oidc"
}
```

**SDK Code**

```python saml (by file)
import requests

url = "http://localhost:8080/api/v1/idps"

querystring = {"tenantId":"1008"}

payload = {
    "type": "saml",
    "samlData": {
        "metadataXmlFile": "<file content in base64>",
        "fileName": "descriptor.xml",
        "metadataXmlType": "file"
    },
    "mappers": {
        "gid": "GID",
        "uid": "UID",
        "groups": "GROUPS",
        "supplementaryGroups": "SUPPLEMENTARYGROUPS",
        "email": "email"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript saml (by file)
const url = 'http://localhost:8080/api/v1/idps?tenantId=1008';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"saml","samlData":{"metadataXmlFile":"<file content in base64>","fileName":"descriptor.xml","metadataXmlType":"file"},"mappers":{"gid":"GID","uid":"UID","groups":"GROUPS","supplementaryGroups":"SUPPLEMENTARYGROUPS","email":"email"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go saml (by file)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/idps?tenantId=1008"

	payload := strings.NewReader("{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlFile\": \"<file content in base64>\",\n    \"fileName\": \"descriptor.xml\",\n    \"metadataXmlType\": \"file\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby saml (by file)
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/idps?tenantId=1008")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlFile\": \"<file content in base64>\",\n    \"fileName\": \"descriptor.xml\",\n    \"metadataXmlType\": \"file\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java saml (by file)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/idps?tenantId=1008")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlFile\": \"<file content in base64>\",\n    \"fileName\": \"descriptor.xml\",\n    \"metadataXmlType\": \"file\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")
  .asString();
```

```php saml (by file)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/idps?tenantId=1008', [
  'body' => '{
  "type": "saml",
  "samlData": {
    "metadataXmlFile": "<file content in base64>",
    "fileName": "descriptor.xml",
    "metadataXmlType": "file"
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp saml (by file)
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/idps?tenantId=1008");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"saml\",\n  \"samlData\": {\n    \"metadataXmlFile\": \"<file content in base64>\",\n    \"fileName\": \"descriptor.xml\",\n    \"metadataXmlType\": \"file\"\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift saml (by file)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "saml",
  "samlData": [
    "metadataXmlFile": "<file content in base64>",
    "fileName": "descriptor.xml",
    "metadataXmlType": "file"
  ],
  "mappers": [
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/idps?tenantId=1008")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### oidc

**Request**

```json
{
  "type": "oidc",
  "oidcData": {
    "clientId": "my-client-id",
    "clientSecret": "my-client-secret",
    "discoverDocumentUrl": "https://authhost/openid-configuration",
    "mandatoryClaim": {
      "claim": "my-claim",
      "values": [
        "val1",
        "val2"
      ]
    }
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}
```

**Response**

```json
{
  "alias": "oidc"
}
```

**SDK Code**

```python oidc
import requests

url = "http://localhost:8080/api/v1/idps"

querystring = {"tenantId":"1008"}

payload = {
    "type": "oidc",
    "oidcData": {
        "clientId": "my-client-id",
        "clientSecret": "my-client-secret",
        "discoverDocumentUrl": "https://authhost/openid-configuration",
        "mandatoryClaim": {
            "claim": "my-claim",
            "values": ["val1", "val2"]
        }
    },
    "mappers": {
        "gid": "GID",
        "uid": "UID",
        "groups": "GROUPS",
        "supplementaryGroups": "SUPPLEMENTARYGROUPS",
        "email": "email"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript oidc
const url = 'http://localhost:8080/api/v1/idps?tenantId=1008';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"oidc","oidcData":{"clientId":"my-client-id","clientSecret":"my-client-secret","discoverDocumentUrl":"https://authhost/openid-configuration","mandatoryClaim":{"claim":"my-claim","values":["val1","val2"]}},"mappers":{"gid":"GID","uid":"UID","groups":"GROUPS","supplementaryGroups":"SUPPLEMENTARYGROUPS","email":"email"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go oidc
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/idps?tenantId=1008"

	payload := strings.NewReader("{\n  \"type\": \"oidc\",\n  \"oidcData\": {\n    \"clientId\": \"my-client-id\",\n    \"clientSecret\": \"my-client-secret\",\n    \"discoverDocumentUrl\": \"https://authhost/openid-configuration\",\n    \"mandatoryClaim\": {\n      \"claim\": \"my-claim\",\n      \"values\": [\n        \"val1\",\n        \"val2\"\n      ]\n    }\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby oidc
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/idps?tenantId=1008")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"oidc\",\n  \"oidcData\": {\n    \"clientId\": \"my-client-id\",\n    \"clientSecret\": \"my-client-secret\",\n    \"discoverDocumentUrl\": \"https://authhost/openid-configuration\",\n    \"mandatoryClaim\": {\n      \"claim\": \"my-claim\",\n      \"values\": [\n        \"val1\",\n        \"val2\"\n      ]\n    }\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java oidc
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/idps?tenantId=1008")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"oidc\",\n  \"oidcData\": {\n    \"clientId\": \"my-client-id\",\n    \"clientSecret\": \"my-client-secret\",\n    \"discoverDocumentUrl\": \"https://authhost/openid-configuration\",\n    \"mandatoryClaim\": {\n      \"claim\": \"my-claim\",\n      \"values\": [\n        \"val1\",\n        \"val2\"\n      ]\n    }\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}")
  .asString();
```

```php oidc
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/idps?tenantId=1008', [
  'body' => '{
  "type": "oidc",
  "oidcData": {
    "clientId": "my-client-id",
    "clientSecret": "my-client-secret",
    "discoverDocumentUrl": "https://authhost/openid-configuration",
    "mandatoryClaim": {
      "claim": "my-claim",
      "values": [
        "val1",
        "val2"
      ]
    }
  },
  "mappers": {
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp oidc
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/idps?tenantId=1008");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"oidc\",\n  \"oidcData\": {\n    \"clientId\": \"my-client-id\",\n    \"clientSecret\": \"my-client-secret\",\n    \"discoverDocumentUrl\": \"https://authhost/openid-configuration\",\n    \"mandatoryClaim\": {\n      \"claim\": \"my-claim\",\n      \"values\": [\n        \"val1\",\n        \"val2\"\n      ]\n    }\n  },\n  \"mappers\": {\n    \"gid\": \"GID\",\n    \"uid\": \"UID\",\n    \"groups\": \"GROUPS\",\n    \"supplementaryGroups\": \"SUPPLEMENTARYGROUPS\",\n    \"email\": \"email\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift oidc
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "oidc",
  "oidcData": [
    "clientId": "my-client-id",
    "clientSecret": "my-client-secret",
    "discoverDocumentUrl": "https://authhost/openid-configuration",
    "mandatoryClaim": [
      "claim": "my-claim",
      "values": ["val1", "val2"]
    ]
  ],
  "mappers": [
    "gid": "GID",
    "uid": "UID",
    "groups": "GROUPS",
    "supplementaryGroups": "SUPPLEMENTARYGROUPS",
    "email": "email"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/idps?tenantId=1008")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### openshift-v4

**Request**

```json
{
  "type": "openshift-v4",
  "ocpData": {
    "idpBaseUrl": "https://authhost/ocp",
    "clientSecret": "my-client-secret",
    "clientId": "my-client-id"
  },
  "mappers": {
    "gid": "metadata.gid",
    "uid": "metadata.uid",
    "groups": "groups",
    "supplementaryGroups": "supplementarygroups",
    "email": "metadata.name"
  }
}
```

**Response**

```json
{
  "alias": "oidc"
}
```

**SDK Code**

```python openshift-v4
import requests

url = "http://localhost:8080/api/v1/idps"

querystring = {"tenantId":"1008"}

payload = {
    "type": "openshift-v4",
    "ocpData": {
        "idpBaseUrl": "https://authhost/ocp",
        "clientSecret": "my-client-secret",
        "clientId": "my-client-id"
    },
    "mappers": {
        "gid": "metadata.gid",
        "uid": "metadata.uid",
        "groups": "groups",
        "supplementaryGroups": "supplementarygroups",
        "email": "metadata.name"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript openshift-v4
const url = 'http://localhost:8080/api/v1/idps?tenantId=1008';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"openshift-v4","ocpData":{"idpBaseUrl":"https://authhost/ocp","clientSecret":"my-client-secret","clientId":"my-client-id"},"mappers":{"gid":"metadata.gid","uid":"metadata.uid","groups":"groups","supplementaryGroups":"supplementarygroups","email":"metadata.name"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go openshift-v4
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/idps?tenantId=1008"

	payload := strings.NewReader("{\n  \"type\": \"openshift-v4\",\n  \"ocpData\": {\n    \"idpBaseUrl\": \"https://authhost/ocp\",\n    \"clientSecret\": \"my-client-secret\",\n    \"clientId\": \"my-client-id\"\n  },\n  \"mappers\": {\n    \"gid\": \"metadata.gid\",\n    \"uid\": \"metadata.uid\",\n    \"groups\": \"groups\",\n    \"supplementaryGroups\": \"supplementarygroups\",\n    \"email\": \"metadata.name\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby openshift-v4
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/idps?tenantId=1008")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"openshift-v4\",\n  \"ocpData\": {\n    \"idpBaseUrl\": \"https://authhost/ocp\",\n    \"clientSecret\": \"my-client-secret\",\n    \"clientId\": \"my-client-id\"\n  },\n  \"mappers\": {\n    \"gid\": \"metadata.gid\",\n    \"uid\": \"metadata.uid\",\n    \"groups\": \"groups\",\n    \"supplementaryGroups\": \"supplementarygroups\",\n    \"email\": \"metadata.name\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java openshift-v4
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/idps?tenantId=1008")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"openshift-v4\",\n  \"ocpData\": {\n    \"idpBaseUrl\": \"https://authhost/ocp\",\n    \"clientSecret\": \"my-client-secret\",\n    \"clientId\": \"my-client-id\"\n  },\n  \"mappers\": {\n    \"gid\": \"metadata.gid\",\n    \"uid\": \"metadata.uid\",\n    \"groups\": \"groups\",\n    \"supplementaryGroups\": \"supplementarygroups\",\n    \"email\": \"metadata.name\"\n  }\n}")
  .asString();
```

```php openshift-v4
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/idps?tenantId=1008', [
  'body' => '{
  "type": "openshift-v4",
  "ocpData": {
    "idpBaseUrl": "https://authhost/ocp",
    "clientSecret": "my-client-secret",
    "clientId": "my-client-id"
  },
  "mappers": {
    "gid": "metadata.gid",
    "uid": "metadata.uid",
    "groups": "groups",
    "supplementaryGroups": "supplementarygroups",
    "email": "metadata.name"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp openshift-v4
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/idps?tenantId=1008");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"openshift-v4\",\n  \"ocpData\": {\n    \"idpBaseUrl\": \"https://authhost/ocp\",\n    \"clientSecret\": \"my-client-secret\",\n    \"clientId\": \"my-client-id\"\n  },\n  \"mappers\": {\n    \"gid\": \"metadata.gid\",\n    \"uid\": \"metadata.uid\",\n    \"groups\": \"groups\",\n    \"supplementaryGroups\": \"supplementarygroups\",\n    \"email\": \"metadata.name\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift openshift-v4
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "openshift-v4",
  "ocpData": [
    "idpBaseUrl": "https://authhost/ocp",
    "clientSecret": "my-client-secret",
    "clientId": "my-client-id"
  ],
  "mappers": [
    "gid": "metadata.gid",
    "uid": "metadata.uid",
    "groups": "groups",
    "supplementaryGroups": "supplementarygroups",
    "email": "metadata.name"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/idps?tenantId=1008")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```