This document will use GitHub as the SSO identity provider to demonstrate how to enable OAuth2 authorization protocol for Dify Enterprise.By enabling this feature, the enterprise login page will use a unified identity authentication entry to enhance security. For enterprise internal users, there’s no need to enter complex passwords - they can log in using organizational accounts to pass verification, simplifying the login process.
This document will mention internal users and external users. The following distinctions are made:
Internal members: Members registered within the Dify Enterprise workspace or added through the admin backend.
External users: Members not within Dify Enterprise
According to the required SSO scope to be enabled, Callback URLs differ. System administrators need to fill the Dify Enterprise Callback URL into the corresponding GitHub OAuth2 application to complete the creation process.
Click Admin Backend → Identity Authentication → Member → SSO Identity Provider → New Identity Provider → New OAuth2 Provider, and view the Workspace Callback URL at the bottom.It usually follows this format:
Access the Dify Enterprise Authentication page, click ”+ New Identity Provider → New OAuth2 Provider”, and fill in the information according to the prompts to complete the configuration.Go to the OAuth application to obtain the following information:
Client ID
Client Secrets
The basic information of different OAuth2 providers varies, please refer to the official documentation of each provider. The following information is for reference only and can be adjusted according to actual needs.