Self-hosting Apidog
  1. Configuration
Self-hosting Apidog
  • Installation
    • Installation Overview
    • Obtaining Apidog On-premises License
    • Running Apidog on Docker
    • Running Apidog on Kubernetes
    • Running Apidog Multi-Container Deployment without Kubernetes
    • Admin Panel
    • Installing Apidog Client
    • Backing up Apidog
    • Renewing Apidog
    • Updating Apidog
    • Supported browsers
    • Privacy
  • Configuration
    • Environment Variables
    • Configuring the application database
    • Configuring the application storage service
    • Using LDAP for authentication
    • Using OKTA for authentication
    • Using OAuth2.0 for authentication
  • Apidog API (coming soon)
  • Troubleshooting
    • Troubleshooting
    • FAQ
  1. Configuration

Using OAuth2.0 for authentication

OAuth 2.0 flow chart:
OAuth-2
Apidog Self-Hosting supports OAuth2.0 (compatible with OIDC) integration and can be configured through Docker environment variables as follows:
The required Redirect URI for your OAuth2 provider configuration is {BASE_URL}/passport/oauth2/callback. Please replace the {BASE_URL} placeholder with the value defined in your container's environment variable.
Please be aware that environment variable values are case-sensitive.
Environment Variable NameMeaningDefault ValueOthers
OAUTH2_ENABLEWhether to enable OAuth2.0 login serviceSet to true to enable, or leave blank or unset to disable
OAUTH2_AUTH_URLOAuth2.0 application login authorization linkRequired when enabling OAuth2.0 service
OAUTH2_ACCESS_TOKEN_URLOAuth2.0 application link to exchange AccessTokenRequired when enabling OAuth2.0 service
OAUTH2_USER_INFO_URLURL to exchange personal information based on access tokenRequired when enabling OAuth2.0 service
OAUTH2_CLIENT_IDOAuth2.0 application IDRequired when enabling OAuth2.0 service
OAUTH2_CLIENT_SECRETOAuth2.0 application access SecretRequired when enabling OAuth2.0 service
OAUTH2_SCOPEScopeemail,profile,openidConfiguration is typically required as described in the provider's documentation. The default value is compatible with Azure AD and Okta.
OAUTH2_USER_ID_ATTRDefault is 'id', used as the unique id for OAuth2.0 user attributesidOptional
OAUTH2_USER_EMAIL_ATTREmail fieldemailOptional
OAUTH2_USER_NAME_ATTRName fieldnameOptional
OAUTH2_USER_AVATAR_ATTRAvatar fieldavatarOptional
OAUTH2_LOGIN_TITLEControl the button text which was showed on client Login pageContinue with OAuth 2.0Optional

Configuration Example#

-e OAUTH2_ENABLE=true
-e OAUTH2_AUTH_URL=https://xxx.example.com/oauth/auth
-e OAUTH2_ACCESS_TOKEN_URL=https://xxx.example.com/oauth/token
-e OAUTH2_CLIENT_ID=6539......c89ae
-e OAUTH2_CLIENT_SECRET=ca67b272......ab449d8b45
-e OAUTH2_USER_INFO_URL=https://core.example.com/oauth/me
Previous
Using OKTA for authentication
Next
Troubleshooting
Built with