Built in provider config
Below is a list of all built in providers for single or multi tenant login / SSO.
#
Google- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "google",
clients: [{
clientId: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
clientSecret: "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",
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "google",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
ClientSecret: "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",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="google",
clients=[
ProviderClientConfig(
client_id="1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
client_secret="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",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "google",
name: "Google",
clients: [{
clientId: "...",
clientSecret: "..."
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "google",
Name: "Google",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="google",
name="Google",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="google",
name="Google",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "google",
"name": "Google",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "google",
"name": "Google",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
#
Google Workspaces- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "google-workspaces",
clients: [{
clientId: "TODO",
clientSecret: "TODO",
additionalConfig: {
"hd": "example.com"
}
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "google-workspaces",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
AdditionalConfig: map[string]interface{}{
"hd": "example.com",
},
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="google-workspaces",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
additional_config={
"hd": "example.com",
},
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "google-workspaces",
name: "Google Workspaces",
clients: [{
clientId: "...",
clientSecret: "...",
additionalConfig: {
"hd": "example.com",
}
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "google-workspaces",
Name: "Google Workspaces",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
AdditionalConfig: map[string]interface{}{
"hd": "example.com",
},
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="google-workspaces",
name="Google Workspaces",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"hd": "example.com",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="google-workspaces",
name="Google Workspaces",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"hd": "example.com",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "google-workspaces",
"name": "Google Workspaces",
"clients": [
{
"clientId": "...",
"clientSecret": "...",
"additionalConfig": {
"hd": "example.com"
}
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "google-workspaces",
"name": "Google Workspaces",
"clients": [
{
"clientId": "...",
"clientSecret": "...",
"additionalConfig": {
"hd": "example.com"
}
}
]
}
}'
#
Apple- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "apple",
clients: [{
clientId: "4398792-io.supertokens.example.service",
additionalConfig: {
"keyId": "7M48Y4RYDL",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
"teamId": "YWQCXGJRJL",
},
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "apple",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "4398792-io.supertokens.example.service",
AdditionalConfig: map[string]interface{}{
"keyId": "7M48Y4RYDL",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
"teamId": "YWQCXGJRJL",
},
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="apple",
clients=[
ProviderClientConfig(
client_id="4398792-io.supertokens.example.service",
additional_config={
"keyId": "7M48Y4RYDL",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
"teamId": "YWQCXGJRJL",
},
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "apple",
name: "Apple",
clients: [{
clientId: "...",
additionalConfig: {
"keyId": "...",
"privateKey": "...",
"teamId": "...",
}
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "apple",
Name: "Apple",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
AdditionalConfig: map[string]interface{}{
"keyId": "...",
"privateKey": "...",
"teamId": "...",
},
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="apple",
name="Apple",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"keyId": "...",
"privateKey": "...",
"teamId": "...",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="apple",
name="Apple",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"keyId": "...",
"privateKey": "...",
"teamId": "...",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "apple",
"name": "Apple",
"clients": [
{
"clientId": "...",
"additionalConfig": {
"keyId": "...",
"privateKey": "...",
"teamId": "..."
}
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "apple",
"name": "Apple",
"clients": [
{
"clientId": "...",
"additionalConfig": {
"keyId": "...",
"privateKey": "...",
"teamId": "..."
}
}
]
}
}'
#
Discord- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "discord",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "discord",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="discord",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "discord",
name: "Discord",
clients: [{
clientId: "...",
clientSecret: "...",
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "discord",
Name: "Discord",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="discord",
name="Discord",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="discord",
name="Discord",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "discord",
"name": "Discord",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "discord",
"name": "Discord",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
#
Facebook- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "facebook",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "facebook",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="facebook",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "facebook",
name: "Facebook",
clients: [{
clientId: "...",
clientSecret: "...",
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "facebook",
Name: "Facebook",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="facebook",
name="Facebook",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="facebook",
name="Facebook",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "facebook",
"name": "Facebook",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "facebook",
"name": "Facebook",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
#
Github- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "github",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "github",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="github",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "github",
name: "GitHub",
clients: [{
clientId: "...",
clientSecret: "...",
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "github",
Name: "GitHub",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="github",
name="GitHub",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="github",
name="GitHub",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "github",
"name": "GitHub",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
curl --location --request PUT '/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "github",
"name": "GitHub",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
#
LinkedIn- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "linkedin",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "linkedin",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="linkedin",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "linkedin",
name: "LinkedIn",
clients: [{
clientId: "...",
clientSecret: "...",
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "linkedin",
Name: "LinkedIn",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="linkedin",
name="LinkedIn",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="linkedin",
name="LinkedIn",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "linkedin",
"name": "LinkedIn",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "linkedin",
"name": "LinkedIn",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
]
}
}'
#
Twitter- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "twitter",
clients: [{
clientId: "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
clientSecret: "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC"
}]
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "twitter",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
ClientSecret: "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="twitter",
clients=[
ProviderClientConfig(
client_id="4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
client_secret="BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "twitter",
name: "Twitter",
clients: [{
clientId: "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
clientSecret: "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
}]
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "twitter",
Name: "Twitter",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
ClientSecret: "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="twitter",
name="Twitter",
clients=[
ProviderClientConfig(
client_id="4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
client_secret="BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="twitter",
name="Twitter",
clients=[
ProviderClientConfig(
client_id="4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
client_secret="BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "twitter",
"name": "Twitter",
"clients": [
{
"clientId": "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
"clientSecret": "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC"
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "twitter",
"name": "Twitter",
"clients": [
{
"clientId": "4398792-WXpqVXRiazdRMGNJdEZIa3RVQXc6MTpjaQ",
"clientSecret": "BivMbtwmcygbRLNQ0zk45yxvW246tnYnTFFq-LH39NwZMxFpdC"
}
]
}
}'
#
Active Directory- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "active-directory",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}],
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "active-directory",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="active-directory",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
oidc_discovery_endpoint="https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "active-directory",
name: "Active Directory",
clients: [{
clientId: "...",
clientSecret: "...",
}],
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "active-directory",
Name: "Active Directory",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="active-directory",
name="Active Directoy",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="active-directory",
name="Active Directoy",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "active-directory",
"name": "Active Directory",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration"
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "active-directory",
"name": "Active Directory",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration"
}
}'
#
Okta- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "okta",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}],
oidcDiscoveryEndpoint: "https://dev-<id>.okta.com/.well-known/openid-configuration",
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "okta",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
OIDCDiscoveryEndpoint: "https://dev-<id>.okta.com/.well-known/openid-configuration",
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="okta",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
oidc_discovery_endpoint="https://dev-<id>.okta.com/.well-known/openid-configuration",
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "okta",
name: "Okta",
clients: [{
clientId: "...",
clientSecret: "...",
}],
oidcDiscoveryEndpoint: "https://dev-<id>.okta.com/.well-known/openid-configuration",
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "okta",
Name: "Okta",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
OIDCDiscoveryEndpoint: "https://dev-<id>.okta.com/.well-known/openid-configuration",
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="okta",
name="Okta",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://dev-<id>.okta.com/.well-known/openid-configuration",
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="okta",
name="Okta",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://dev-<id>.okta.com/.well-known/openid-configuration",
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "okta",
"name": "Okta",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://dev-<id>.okta.com/.well-known/openid-configuration"
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "okta",
"name": "Okta",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://dev-<id>.okta.com/.well-known/openid-configuration"
}
}'
#
Bitbucket- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "bitbucket",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}],
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "bitbucket",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="bitbucket",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "bitbucket",
name: "Bitbucket",
clients: [{
clientId: "...",
clientSecret: "...",
}],
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "bitbucket",
Name: "Bitbucket",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="bitbucket",
name="Bitbucket",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="bitbucket",
name="Bitbucket",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "bitbucket",
"name": "Bitbucket",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "bitbucket",
"name": "Bitbucket",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
}
}'
#
GitLab- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "gitlab",
clients: [{
clientId: "TODO",
clientSecret: "TODO"
}],
oidcDiscoveryEndpoint: "https://gitlab.example.com/.well-known/openid-configuration",
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "gitlab",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
},
},
OIDCDiscoveryEndpoint: "https://gitlab.example.com/.well-known/openid-configuration",
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="gitlab",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
),
],
oidc_discovery_endpoint="https://gitlab.example.com/.well-known/openid-configuration"
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "gitlab",
name: "GitLab",
clients: [{
clientId: "...",
clientSecret: "...",
}],
oidcDiscoveryEndpoint: "https://gitlab.example.com/.well-known/openid-configuration",
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "gitlab",
Name: "GitLab",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
},
},
OIDCDiscoveryEndpoint: "https://gitlab.example.com/.well-known/openid-configuration",
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="gitlab",
name="Gitlab",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://gitlab.example.com/.well-known/openid-configuration"
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="gitlab",
name="Gitlab",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
),
],
oidc_discovery_endpoint="https://gitlab.example.com/.well-known/openid-configuration"
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "gitlab",
"name": "GitLab",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://gitlab.example.com/.well-known/openid-configuration"
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "gitlab",
"name": "GitLab",
"clients": [
{
"clientId": "...",
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://gitlab.example.com/.well-known/openid-configuration"
}
}'
#
SAML login- Single Tenant
- Multi Tenant
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import SuperTokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
supertokens: {
connectionURI: "...",
},
recipeList: [
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "boxy-saml",
name: "<provider-name>", // Replace with the correct provider name
clients: [{
clientId: "TODO",
clientSecret: "TODO",
additionalConfig: {
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>"
}
}],
}
}
]
}
}), // initializes signin / sign up features
]
});
import (
"github.com/supertokens/supertokens-golang/recipe/thirdparty"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
"github.com/supertokens/supertokens-golang/supertokens"
)
func main() {
supertokens.Init(supertokens.TypeInput{
RecipeList: []supertokens.Recipe{
thirdparty.Init(&tpmodels.TypeInput{
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
Providers: []tpmodels.ProviderInput{
{
Config: tpmodels.ProviderConfig{
ThirdPartyId: "boxy-saml",
Name: "<provider-name>",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "TODO:",
ClientSecret: "TODO:",
AdditionalConfig: map[string]interface{}{
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
},
},
},
},
},
},
},
}),
},
})
}
from supertokens_python import init, InputAppInfo
from supertokens_python.recipe import thirdparty
from supertokens_python.recipe.thirdparty import ProviderInput, ProviderConfig, ProviderClientConfig, SignInAndUpFeature
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
framework='...',
recipe_list=[
thirdparty.init(
sign_in_and_up_feature=SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="boxy-saml",
name="<provider-name>",
clients=[
ProviderClientConfig(
client_id="TODO:",
client_secret="TODO:",
additional_config={
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
},
),
],
),
),
]
)
)
]
)
Call the following function / API to add the third party provider to a specific tenant.
- Dashboard
- NodeJS
- GoLang
- Python
- cURL
Important
import Multitenancy from "supertokens-node/recipe/multitenancy";
async function addThirdPartyToTenant() {
let resp = await Multitenancy.createOrUpdateThirdPartyConfig("customer1", {
thirdPartyId: "boxy-saml",
name: "<provider-name>",
clients: [{
clientId: "...",
clientSecret: "...",
additionalConfig: {
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
}
}],
});
if (resp.createdNew) {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
import (
"github.com/supertokens/supertokens-golang/recipe/multitenancy"
"github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
)
func main() {
tenantId := "customer1"
resp, err := multitenancy.CreateOrUpdateThirdPartyConfig(tenantId, tpmodels.ProviderConfig{
ThirdPartyId: "boxy-saml",
Name: "<provider-name>",
Clients: []tpmodels.ProviderClientConfig{
{
ClientID: "...",
ClientSecret: "...",
AdditionalConfig: map[string]interface{}{
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
},
},
},
}, nil)
if err != nil {
// handle error
}
if resp.OK.CreatedNew {
// Provider added to customer1
} else {
// Existing provider config overwritten for customer1
}
}
- Asyncio
- Syncio
from supertokens_python.recipe.multitenancy.asyncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
async def some_func():
tenant_id = "customer1"
result = await create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="boxy-saml",
name="<provider-name>",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
from supertokens_python.recipe.multitenancy.syncio import create_or_update_third_party_config
from supertokens_python.recipe.thirdparty.provider import ProviderConfig, ProviderClientConfig
tenant_id = "customer1"
result = create_or_update_third_party_config(tenant_id, ProviderConfig(
third_party_id="boxy-saml",
name="<provider-name>",
clients=[
ProviderClientConfig(
client_id="...",
client_secret="...",
additional_config={
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>",
},
),
],
))
if result.status != "OK":
print("handle error")
elif result.created_new:
print("Provider added to customer1")
else:
print("Existing provider config overwritten for customer1")
- Single app setup
- Multi app setup
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "boxy-SAML",
"name": "<provider-name>",
"clients": [
{
"clientId": "...",
"clientSecret": "...",
"additionalConfig": {
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>"
}
}
]
}
}'
curl --location --request PUT '/<TENANT_ID>/recipe/multitenancy/config/thirdparty' \
--header 'api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"thirdPartyId": "boxy-SAML",
"name": "<provider-name>",
"clients": [
{
"clientId": "...",
"clientSecret": "...",
"additionalConfig": {
"boxyURL": "<TODO: Example: http://domain.example.com:5225/>"
}
}
]
}
}'
To configure SAML login with SuperTokens, ensure that you use the correct provider name in the third-party config.
Make sure to replace <provider-name>
in the code snippet above with one of the following
- Microsoft Entra ID
- Microsoft AD FS
- Okta
- Auth0
- Google
- OneLogin
- PingOne
- JumpCloud
- Rippling
- SAML