Skip to content

Commit 706c9e3

Browse files
rgrunblanijel
authored andcommitted
Fix the documentation for keycloak 20.0* and more
1 parent 017935a commit 706c9e3

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

social_core/backends/keycloak.py

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,55 @@ class KeycloakOAuth2(BaseOAuth2): # pylint: disable=abstract-method
2525
2626
To set up, please take the following steps:
2727
28-
1. Create a new Keycloak client in the Clients section.
28+
1. Create a new Keycloak client in the Clients section:
29+
30+
a. Choose the `Client ID` in the `General Settings` pane.
31+
32+
b. Select `Client authentication` and `Authorization` in the
33+
`Capability config` pane.
2934
3035
2. Configure the following parameters in the Client setup:
3136
3237
Settings >
3338
Client ID (copy to settings as `KEY` value)
3439
Credentials >
3540
Client Authenticator >
36-
Secret (copy to settings as `SECRET` value)
41+
Use `Client Id and Secret` and copy the `Client secret` value
42+
to settings as `SECRET` value
3743
3844
3. For the tokens to work with the JWT setup the following configuration has
3945
to be made in Keycloak:
4046
41-
Settings >
42-
Access Type >
43-
confidential
44-
Settings >
45-
Fine Grain OpenID Connect Configuration >
46-
User Info Signed
47-
Response Algorithm >
48-
RS256
49-
Settings >
50-
Fine Grain OpenID Connect Configuration >
51-
Request Object Signature Algorithm > RS256
47+
Advanced >
48+
Fine grain OpenID Connect configuration >
49+
User Info Signed Response Algorithm >
50+
RS256
51+
Advanced >
52+
Fine grain OpenID Connect configuration >
53+
Request Object Signature Algorithm >
54+
RS256
55+
56+
4. Re-enable the audience (see https://issues.redhat.com/browse/KEYCLOAK-6638
57+
for context):
58+
59+
Go to Client scopes > YOUR-CLIENT-ID-dedicated > Add mapper > Audience, pick
60+
a name for the mapper and select the Client ID corresponding to your client
61+
in `Included Client Audience`.
5262
53-
4. Get the public key (copy to settings as `PUBLIC_KEY` value) to be used
63+
5. Get the public key (copy to settings as `PUBLIC_KEY` value) to be used
5464
with the backend:
5565
5666
Realm Settings > Keys > Public key
5767
58-
5. Configure access token fields are configured via the Keycloak Client
68+
6. Configure access token fields are configured via the Keycloak Client
5969
mappers:
6070
6171
Clients > Client ID > Mappers
6272
6373
They have to include at least the `ID_KEY` value and the dictionary keys
6474
defined in the `get_user_details` method.
6575
66-
6. Configure your web backend. Example setting values for Django settings
76+
7. Configure your web backend. Example setting values for Django settings
6777
could be:
6878
6979
SOCIAL_AUTH_KEYCLOAK_KEY = 'example'
@@ -75,7 +85,7 @@ class KeycloakOAuth2(BaseOAuth2): # pylint: disable=abstract-method
7585
SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL = \
7686
'https://sso.com/auth/realms/example/protocol/openid-connect/token'
7787
78-
7. The default behaviour is to associate users via username field, but you
88+
8. The default behaviour is to associate users via username field, but you
7989
can change the key with e.g.
8090
8191
SOCIAL_AUTH_KEYCLOAK_ID_KEY = 'email'

0 commit comments

Comments
 (0)