from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# source_authentication_id is the OAuth2 method id from auth_providers.sources()
# secret slots are write-only: a read returns has_value, never the value
provider = client.auth_providers.create(
provider_name="Acme Salesforce",
application_id=17,
source_authentication_id=2,
field_values={"Key1": "your-client-id", "Key2": "your-client-secret"},
)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// sourceAuthenticationId is the OAuth2 method id from authProviders.sources()
// secret slots are write-only: a read returns hasValue, never the value
const provider = await client.authProviders.create({
providerName: "Acme Salesforce",
applicationId: 17,
sourceAuthenticationId: 2,
isDefault: false,
isSandbox: false,
fieldValues: { Key1: "your-client-id", Key2: "your-client-secret" },
});# --field-stdin keeps the secret out of your shell history
echo "your-client-secret" | engini connections auth-providers create \
--app salesforce --name "Acme Salesforce" --field Key1=your-client-id --field-stdin Key2const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerName: '<string>',
applicationId: 123,
sourceAuthenticationId: 123,
isDefault: true,
isSandbox: true,
scopesOverride: '<string>',
extraOptions: '<string>',
fieldValues: {}
})
};
fetch('https://api.engini.io/v1/auth-providers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/auth-providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerName' => '<string>',
'applicationId' => 123,
'sourceAuthenticationId' => 123,
'isDefault' => true,
'isSandbox' => true,
'scopesOverride' => '<string>',
'extraOptions' => '<string>',
'fieldValues' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/auth-providers"
payload := strings.NewReader("{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/auth-providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/auth-providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"providerName": "<string>",
"applicationId": 123,
"sourceAuthenticationId": 123,
"isDefault": true,
"isSandbox": true,
"status": 123,
"connectorRemoved": true,
"noLongerSupported": true,
"connectionCount": 123,
"fields": [
{
"slot": "<string>",
"isPassword": true,
"isRequired": true,
"isReadOnly": true,
"inputType": 0,
"minValue": 123,
"maxValue": 123,
"label": "<string>",
"tooltip": "<string>",
"placeholder": "<string>",
"value": "<string>",
"hasValue": true
}
],
"fieldsNeedReview": true,
"applicationName": "<string>",
"applicationLogo": "<string>",
"sourceAuthenticationName": "<string>",
"scopesOverride": "<string>",
"extraOptions": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Create an auth provider.
Fills the “Set on provider” fields of one authentication method of a published connector once, for every connection signed in through the provider. The method must allow auth providers and be an OAuth2 method. Password field values are write-only. clientId and clientSecret are not accepted (400): where a connector lets you bring your own OAuth client, it marks those fields “Set on provider” and they go in fieldValues.
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# source_authentication_id is the OAuth2 method id from auth_providers.sources()
# secret slots are write-only: a read returns has_value, never the value
provider = client.auth_providers.create(
provider_name="Acme Salesforce",
application_id=17,
source_authentication_id=2,
field_values={"Key1": "your-client-id", "Key2": "your-client-secret"},
)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// sourceAuthenticationId is the OAuth2 method id from authProviders.sources()
// secret slots are write-only: a read returns hasValue, never the value
const provider = await client.authProviders.create({
providerName: "Acme Salesforce",
applicationId: 17,
sourceAuthenticationId: 2,
isDefault: false,
isSandbox: false,
fieldValues: { Key1: "your-client-id", Key2: "your-client-secret" },
});# --field-stdin keeps the secret out of your shell history
echo "your-client-secret" | engini connections auth-providers create \
--app salesforce --name "Acme Salesforce" --field Key1=your-client-id --field-stdin Key2const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerName: '<string>',
applicationId: 123,
sourceAuthenticationId: 123,
isDefault: true,
isSandbox: true,
scopesOverride: '<string>',
extraOptions: '<string>',
fieldValues: {}
})
};
fetch('https://api.engini.io/v1/auth-providers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/auth-providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerName' => '<string>',
'applicationId' => 123,
'sourceAuthenticationId' => 123,
'isDefault' => true,
'isSandbox' => true,
'scopesOverride' => '<string>',
'extraOptions' => '<string>',
'fieldValues' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/auth-providers"
payload := strings.NewReader("{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/auth-providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/auth-providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerName\": \"<string>\",\n \"applicationId\": 123,\n \"sourceAuthenticationId\": 123,\n \"isDefault\": true,\n \"isSandbox\": true,\n \"scopesOverride\": \"<string>\",\n \"extraOptions\": \"<string>\",\n \"fieldValues\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"providerName": "<string>",
"applicationId": 123,
"sourceAuthenticationId": 123,
"isDefault": true,
"isSandbox": true,
"status": 123,
"connectorRemoved": true,
"noLongerSupported": true,
"connectionCount": 123,
"fields": [
{
"slot": "<string>",
"isPassword": true,
"isRequired": true,
"isReadOnly": true,
"inputType": 0,
"minValue": 123,
"maxValue": 123,
"label": "<string>",
"tooltip": "<string>",
"placeholder": "<string>",
"value": "<string>",
"hasValue": true
}
],
"fieldsNeedReview": true,
"applicationName": "<string>",
"applicationLogo": "<string>",
"sourceAuthenticationName": "<string>",
"scopesOverride": "<string>",
"extraOptions": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Body
The provider to create.
Creates an auth provider.
Response
The created auth provider.
An account's auth provider for one authentication method of one application: the values of the method's "Set on provider" connection fields, filled once and used by every connection signed in through it. A password field's value is write-only and never appears in a response.