Flarum
Casdoor can use OAuth2 to connect various applications. In this example, we will show you how to use OAuth2 to connect Flarum to your applications.
Here are some configuration names you will need:
CASDOOR_HOSTNAME
: The domain name or IP where the Casdoor server is deployed.
Flarum_HOSTNAME
: The domain name or IP where Flarum is deployed.
Step 1: Deploy Casdoor and Flarum
First, deploy Casdoor and Flarum.
After a successful deployment, make sure:
- You have downloaded the Flarum plugin FoF Passport.
- Casdoor can be logged in and used normally.
- You can set CASDOOR_HOSTNAME =
http://localhost:8000
when deploying Casdoor inprod
mode. See production mode.
Step 2: Configure Casdoor application
- Create a new Casdoor application or use an existing one.
- Find the redirect URL:
<CASDOOR_HOSTNAME>/auth/passport
. - Add the redirect URL to the Casdoor application:
On the application settings page, you will find two values: Client ID
and Client secret
. We will use these values in the next step.
Open your favorite browser and visit: http://CASDOOR_HOSTNAME
/.well-known/openid-configuration. You will see the OIDC configuration of Casdoor.
Step 3: Configure Flarum
- Install the plugin FoF Passport.
- Configure the app:
- Find the Client ID and Client Secret in the Casdoor application page.
Token server URL
: http://CASDOOR_HOSTNAME
/api/login/oauth/access_tokenAuthorization server URL
: http://CASDOOR_HOSTNAME
/login/oauth/authorizeUserInfo server URL
: http://CASDOOR_HOSTNAME
/api/get-accountScopes
:address phone openid profile offline_access email
Log out of Flarum and test SSO.