Skip to main content

Version: latest

Configure SSO for the Developer Portal

The Developer Portal supports Single Sign-On (SSO) through external identity providers, allowing developers to authenticate using their existing organizational credentials. SSO is configured as login options in the Provider Portal, separate from the Dashboard SSO configuration.

Supported Protocols

ProtocolDescription
OIDCOpenID Connect. Integrates with providers such as Keycloak, Okta, Auth0, and Azure AD.
SAMLSecurity Assertion Markup Language 2.0. Integrates with enterprise identity providers.
LDAPLightweight Directory Access Protocol. Integrates with directory services such as Active Directory.
CASCentral Authentication Service. Integrates with CAS servers.

Create a Login Option

OIDC

curl "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Okta SSO",
"provider_type": "oidc",
"enabled": true,
"config": {
"issuer": "https://your-org.okta.com",
"client_id": "<oidc-client-id>",
"client_secret": "<oidc-client-secret>",
"request_scopes": ["openid", "profile", "email"],
"ssl_verify": true,
"attributes": {
"username": "preferred_username",
"email": "email",
"name": "name"
}
}
}'

OIDC configuration fields:

FieldRequiredDescription
issuerYesThe OIDC issuer URL.
client_idYesThe OAuth 2.0 client ID.
client_secretYesThe OAuth 2.0 client secret.
request_scopesNoScopes to request during authentication.
root_urlNoOverride the root URL for callback generation.
ssl_verifyNoWhether to verify TLS certificates (default: true).
callback_urlRead-onlyAuto-generated callback URL. Configure this in your identity provider.
logout_urlNoURL to redirect to after logout.
attributesNoMapping from identity provider claims to developer fields (username, email, name).

SAML

curl "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Corporate SAML",
"provider_type": "saml",
"enabled": true,
"config": {
"entity_id": "https://portal.example.com",
"idp_metadata_url": "https://idp.example.com/metadata",
"sign_request": true,
"attributes": {
"username": "urn:oid:0.9.2342.19200300.100.1.1",
"email": "urn:oid:0.9.2342.19200300.100.1.3",
"name": "urn:oid:2.5.4.3"
}
}
}'

SAML configuration fields:

FieldRequiredDescription
entity_idYesThe Service Provider entity ID.
idp_metadata_urlYesURL to the Identity Provider's SAML metadata.
sp_root_urlNoOverride the Service Provider root URL.
sign_requestNoWhether to sign SAML requests (default: false).
certificateNoX.509 certificate for request signing. Auto-generated if signing is enabled and no certificate is provided.
private_keyNoPrivate key for request signing.
attributesNoMapping from SAML attributes to developer fields.
logout_idp_sessionNoWhether to perform single logout with the IdP.

LDAP

curl "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Active Directory",
"provider_type": "ldap",
"enabled": true,
"config": {
"host": "ldap.example.com",
"port": 636,
"base_dn": "dc=example,dc=com",
"bind_dn": "cn=admin,dc=example,dc=com",
"bind_password": "<ldap-password>",
"identifier": "uid",
"use_ssl": true,
"ssl_verify": true,
"attributes": {
"username": "uid",
"email": "mail",
"name": "cn"
}
}
}'

LDAP configuration fields:

FieldRequiredDescription
hostYesLDAP server hostname.
portYesLDAP server port (389 for LDAP, 636 for LDAPS).
base_dnYesBase distinguished name for user searches.
bind_dnYesDN used to bind to the LDAP server.
bind_passwordYesPassword for the bind DN.
identifierYesLDAP attribute used as the login identifier (for example, uid or sAMAccountName).
use_sslNoWhether to use LDAPS (default: false).
ssl_verifyNoWhether to verify TLS certificates (default: true).
root_ca_certNoCustom CA certificate for TLS verification.
client_certNoClient certificate for mTLS.
client_keyNoClient private key for mTLS.
timeoutNoConnection timeout in seconds.
attributesNoMapping from LDAP attributes to developer fields.

CAS

curl "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CAS Server",
"provider_type": "cas",
"enabled": true,
"config": {
"url": "https://cas.example.com/cas",
"send_service": true,
"ssl_verify": true,
"attributes": {
"username": "uid",
"email": "mail",
"name": "cn"
}
}
}'

CAS configuration fields:

FieldRequiredDescription
urlYesCAS server URL.
send_serviceNoWhether to send the service parameter in CAS requests.
ssl_verifyNoWhether to verify TLS certificates (default: true).
attributesNoMapping from CAS attributes to developer fields.

Managing Login Options

Enable/Disable

Toggle a login option without deleting its configuration:

curl -X PUT "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options/{login_option_id}" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'

Delete

curl -X DELETE "https://{ADMIN_API_URL}/api/portals/{portal_id}/login_options/{login_option_id}" \
-H "Authorization: Bearer $API_TOKEN"
caution

At least one login option must remain enabled at all times. The built-in login option can be disabled but not deleted.

Sensitive Field Handling

Sensitive fields (client_secret, private_key, bind_password, client_key) are masked in API responses after creation. To update a sensitive field, include the new value in the update request. Fields that support the $env://VAR_NAME syntax can reference environment variables instead of containing the secret directly.

Developers Authenticated via SSO

Developers who authenticate through an SSO login option have their provider field set to sso. Their accounts are created automatically on first login, with profile information populated from the identity provider attributes.

Additional Resources

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation