Hanzo
PlatformHanzo IAMIntegrationsPHP

Flarum

Using OAuth2 to connect various applications, like Flarum

Hanzo IAM can use OAuth2 to connect various applications. In this example, we will show you how to use OAuth2 to connect Flarum to your applications.

Note these variables:

IAM_HOSTNAME: The domain name or IP where the Hanzo IAM server is deployed.

Flarum_HOSTNAME: The domain name or IP where Flarum is deployed.

Step 1: Deploy Hanzo IAM and Flarum

First, deploy Hanzo IAM and Flarum.

After a successful deployment, make sure:

  1. You have downloaded the Flarum plugin FoF Passport.
  2. Hanzo IAM can be logged in and used normally.
  3. For local prod mode, set IAM_HOSTNAME = http://localhost:8000. See production mode.

Step 2: Configure Hanzo IAM application

  1. Create a new Hanzo IAM application or use an existing one.
  2. Find the redirect URL: <IAM_HOSTNAME>/auth/passport.
  3. Add the redirect URL to the Hanzo IAM application: Redirect

Note Client ID and Client secret for the next step.

Open http://IAM_HOSTNAME/.well-known/openid-configuration in a browser to view Hanzo IAM's OIDC configuration.

Step 3: Configure Flarum

  1. Install the plugin FoF Passport.
  2. Configure the app: configure
  3. Find the Client ID and Client Secret in the Hanzo IAM application page.
  • Token server URL: http://IAM_HOSTNAME/oauth/token
  • Authorization server URL: http://IAM_HOSTNAME/oauth/authorize
  • UserInfo server URL: http://IAM_HOSTNAME/api/get-account
  • Scopes: address phone openid profile offline_access email

Log out of Flarum and test SSO. Flarum Login

How is this guide?

Last updated on

On this page