docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md
[!NOTE] This page contains instructions on how to set up <a class="reference-link" href="../Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a> with various providers such as Authelia, GitLab,. Google. Note that while the configuration reference is correct and up to date, the steps to create the OAuth application might differ slightly as providers change their UI.
Generate a client secret:
authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
Random Password goes to Trilium, Digest (the $pbkdf2-sha512$… string) goes to Authelia.
Add a client under identity_providers.oidc.clients in Authelia's configuration.yml, replacing <server> with the URL of your Trilium instance:
identity_providers:
oidc:
clients:
- client_id: 'trilium'
client_name: 'Trilium'
client_secret: '<Digest>'
public: false
authorization_policy: 'two_factor'
redirect_uris:
- 'https://<server>/callback'
scopes:
- 'openid'
- 'profile'
- 'email'
Unlike GitLab, client_id is a name you choose rather than one the provider generates.
Restart Authelia.
Adjust config.ini, using the Random Password from step 1:
[MultiFactorAuthentication]
oauthBaseUrl=https://<server>
oauthClientId=<ClientId>
oauthClientSecret=<RandomPassword>
oauthIssuerBaseUrl=https://<server>
oauthIssuerName=Authelia
[!IMPORTANT] Do not set
oauthClientAuthMethodfor Authelia. It defaults confidential clients toclient_secret_basicand rejects any other method withinvalid_client, which is the default Trilium already uses. This is the opposite of the GitLab case below.
https://<server>/callbackAdjust config.ini as follows, replacing <ApplicationId> and <Secret> with the values from the last step as well as the <server> with a URL to your Trilium instance.
[MultiFactorAuthentication]
oauthBaseUrl=https://<server>
oauthClientId=<ApplicationId>
oauthClientSecret=<Secret>
oauthIssuerBaseUrl=https://gitlab.com
oauthIssuerName=GitLab
oauthClientAuthMethod=client_secret_post
[!IMPORTANT] If you are using a self-hosted instance of GitLab, make sure to also update
oauthIssuerBaseUrl, and keep theoauthClientAuthMethodline above.GitLab's token endpoint does not decode credentials sent via HTTP Basic, so without
oauthClientAuthMethod, sign-in fails with aserver responded with a challenge in the WWW-Authenticate HTTP Headererror. Trilium applies this automatically forgitlab.com, but a self-hosted issuer URL cannot be detected.
GitHub cannot be used as an identity provider because it is plain OAuth 2.0 and not OpenID Connect, so it will fail with OAUTH_RESPONSE_IS_NOT_CONFORM.
https://<server>/callback.Adjust config.ini as follows, replacing <ClientID> and <ClientSecret> with the values from the last step as well as the <server> with a URL to your Trilium instance.
[MultiFactorAuthentication]
oauthBaseUrl=https://<server>
oauthClientId=<ClientID>
oauthClientSecret=<ClientSecret>