This article will guide you through the steps to set up Authentik as an SSO provider for EspoCRM, ensuring a seamless and secure authentication experience for your users. By implementing Authentik, you can simplify the login process and increase the overall security of your EspoCRM system. So, let’s get started!
Configure Authentik for EspoCRM
- Log in to your Authentik
- Go to Admin interface
- Click on Applications in left menu
- Choose Providers tab
- Create new Provider
- In Provider configurator:
- Choose OAuth2/OpenID Provider and click next
- Make sure that your Authorization flow is set to
Authorize Application (default-provider-authorization-explicit-consent)
- Make sure that Client type is set to
Confidential
- Set Redirect URIs/Origins (RegEx) to your cloudflare link, which should be
http://<your-espocrm-url>/oauth-callback.php
- Set Signing Key to
authentic Self-signed Certificate
- Click on Finish button.
- Go to Applications
- In Application configuration:
- Enter name for your application
- Choose previously created provider as Provider for your application
- Make sure that Policy engine mode is set to
ANY, any policy must match to grant access
- Click on Create button
- Get back to Providers and click on previously created provider
Configure Authentik as OIDC in EspoCRM
- Log in to user with admin rights.
- Go to
Administration > Authentication
. - Change Authentication Method to OIDC.
- Scroll down to OIDC section.
- In OIDC configurator:
- Copy from Authentik Provider settings Client ID and paste in EspoCRM configurator as Client ID
- Copy from Authentik Provider settings Client Secret and paste in EspoCRM configurator as Client Secret
- Copy from Authentik Provider settings Authorize URL and paste in EspoCRM configurator as Authorization Endpoint
- Copy from Authentik Provider settings Token URL and paste in EspoCRM configurator as Token Endpoint
- Copy from Authentik Provider settings JWKS URL and paste in EspoCRM configurator as JSON Web Key Set Endpoint
- Copy from Authentik Provider settings Logout URL and paste in EspoCRM configurator as Logout URL
- Make sure that you’ve choose RS256 in JWT Allowed Signature Algorithms field
- Click Save
- Open EspoCRM in Private mode and try to log in.