Skip to content

Commit 98ff547

Browse files
authored
Fix OIDC_SCOPE Doc & Add Authentik Example
1 parent 79ad376 commit 98ff547

2 files changed

Lines changed: 42 additions & 3 deletions

File tree

119 KB
Loading

docs/oidc.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OIDC_SCOPE="openid"
3030
|OIDC_URL_AUTHORIZE|The url used to authorize your users|
3131
|OIDC_URL_ACCESS_TOKEN|The url used to get the access token|
3232
|OIDC_URL_RESOURCE_OWNER_DETAILS|The ur used to get the authenticated user details|
33-
|OIDC_SCOPE|The scopes that will be used to get information for your authenticated user. Separated by comma (,)|
33+
|OIDC_SCOPE|The scopes that will be used to get information for your authenticated user. Separated by comma Whitespace|
3434

3535
## Example - Keycloak
3636

@@ -48,7 +48,7 @@ OIDC_REALM="YOUR_OIDC_REALM"
4848
OIDC_URL_AUTHORIZE="${OIDC_DISCOVERY_ENDPOINT}/realms/${OIDC_REALM}/protocol/openid-connect/auth"
4949
OIDC_URL_ACCESS_TOKEN="${OIDC_DISCOVERY_ENDPOINT}/realms/${OIDC_REALM}/protocol/openid-connect/token"
5050
OIDC_URL_RESOURCE_OWNER_DETAILS="${OIDC_DISCOVERY_ENDPOINT}/realms/${OIDC_REALM}/protocol/openid-connect/userinfo"
51-
OIDC_SCOPE="openid"
51+
OIDC_SCOPE="openid profile email"
5252
```
5353

5454
3. Make sure in your administration **General settings** you have enabled `Enable OIDC login?` flag:
@@ -59,8 +59,47 @@ OIDC_SCOPE="openid"
5959

6060
![oidc-connect.png](_media/oidc-connect.png)
6161

62+
## Example - Authentik
63+
64+
In this example we will use the Authentik Docker image, but feel free to use another OIDC provider.
65+
66+
1. Follow the steps in the Authentik documentation for the Setup you like, here we used the docker-compose Setup: [https://goauthentik.io/docs/installation/docker-compose](https://goauthentik.io/docs/installation/docker-compose)
67+
2. Add a OpenID Property in Authentik
68+
Go to the Admin Panel under Customisation -> Property Mappings. Create a new Mapping as "Scope Mapping" with the following values:
69+
70+
|Attribute|Value|
71+
|---|---|
72+
|Name|ex. Family_Name OpenID|
73+
|Scope|profile|
74+
|Description| |
75+
|Expression| ```return { "family_name": "" } ```|
76+
77+
When creating a new OpenID Provider you have to go to "Advanced protocol settings" and select the previously named scope additionally.
78+
79+
![authentik-provider-scopes.png](_media/authentik-provider-scopes.png)
80+
81+
3. Configure the environment variables, in your `.env` file:
82+
83+
```env
84+
OIDC_CLIENT_ID="YOUR_CLIENT_ID"
85+
OIDC_CLIENT_SECRET="YOUR_CLIENT_SECRET"
86+
OIDC_DISCOVERY_ENDPOINT="https://authentik.company"
87+
OIDC_REDIRECT_URI="${APP_URL}/oidc/callback"
88+
OIDC_URL_AUTHORIZE="${OIDC_DISCOVERY_ENDPOINT}/application/o/authorize/"
89+
OIDC_URL_ACCESS_TOKEN="${OIDC_DISCOVERY_ENDPOINT}/application/o/token/"
90+
OIDC_URL_RESOURCE_OWNER_DETAILS="${OIDC_DISCOVERY_ENDPOINT}/application/o/userinfo/"
91+
OIDC_SCOPE="openid profile email"
92+
```
93+
94+
4. Make sure in your administration **General settings** you have enabled `Enable OIDC login?` flag:
95+
96+
![settings.png](_media/settings.png)
97+
98+
5. Your users can now click the button **OIDC Connect** in the login page:
99+
100+
![oidc-connect.png](_media/oidc-connect.png)
101+
62102
> Feel free to customize your login page, by enabling / disabling login sections:
63103
> - Form login
64104
> - Social login
65105
> - OIDC login
66-

0 commit comments

Comments
 (0)