Skip to content

Commit acf0481

Browse files
committed
Update README to include Keycloak SSO OIDC setup and bump framework version to 3.2.0
1 parent 8b51908 commit acf0481

1 file changed

Lines changed: 47 additions & 15 deletions

File tree

README.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,29 @@ Check out the [Spring User Framework Demo Application](https://github.com/devond
3030
- [Authentication](#authentication)
3131
- [Local Authentication](#local-authentication)
3232
- [OAuth2/SSO](#oauth2sso)
33+
- [**SSO OIDC with Keycloak**](#sso-oidc-with-keycloak)
3334
- [Extensibility](#extensibility)
3435
- [Custom User Profiles](#custom-user-profiles)
36+
- [SSO OAuth2 with Google and Facebook](#sso-oauth2-with-google-and-facebook)
3537
- [Examples](#examples)
3638
- [Reference Documentation](#reference-documentation)
3739
- [License](#license)
3840

3941
## Features
4042

4143
- **User Registration and Authentication**
42-
The framework provides support for the following features:
43-
- Registration, with optional email verification.
44-
- Login and logout functionality.
45-
- Forgot password flow.
46-
- Database-backed user store using Spring JPA.
47-
- SSO support for Google
48-
- SSO support for Facebook
49-
- SSO support for Keycloak
50-
- Configuration options to control anonymous access, whitelist URIs, and protect specific URIs requiring a logged-in user session.
51-
- CSRF protection enabled by default, with example jQuery AJAX calls passing the CSRF token from the Thymeleaf page context.
52-
- Audit event framework for recording and logging security events, customizable to store audit events in a database or publish them via a REST API.
53-
- Role and Privilege setup service to define roles, associated privileges, and role inheritance hierarchy using `application.yml`.
54-
- Configurable Account Lockout after too many failed login attempts
44+
- Registration, with optional email verification.
45+
- Login and logout functionality.
46+
- Forgot password flow.
47+
- Database-backed user store using Spring JPA.
48+
- SSO support for Google
49+
- SSO support for Facebook
50+
- SSO support for Keycloak
51+
- Configuration options to control anonymous access, whitelist URIs, and protect specific URIs requiring a logged-in user session.
52+
- CSRF protection enabled by default, with example jQuery AJAX calls passing the CSRF token from the Thymeleaf page context.
53+
- Audit event framework for recording and logging security events, customizable to store audit events in a database or publish them via a REST API.
54+
- Role and Privilege setup service to define roles, associated privileges, and role inheritance hierarchy using `application.yml`.
55+
- Configurable Account Lockout after too many failed login attempts
5556

5657
- **Advanced Security**
5758
- Role and privilege-based authorization
@@ -80,14 +81,14 @@ The framework provides support for the following features:
8081
<dependency>
8182
<groupId>com.digitalsanctuary</groupId>
8283
<artifactId>ds-spring-user-framework</artifactId>
83-
<version>3.1.1</version>
84+
<version>3.2.0</version>
8485
</dependency>
8586
```
8687

8788
### Gradle
8889

8990
```groovy
90-
implementation 'com.digitalsanctuary:ds-spring-user-framework:3.1.1'
91+
implementation 'com.digitalsanctuary:ds-spring-user-framework:3.2.0'
9192
```
9293

9394
## Quick Start
@@ -244,6 +245,7 @@ Support for social login providers:
244245
- Google
245246
- Facebook
246247
- Apple
248+
- Keycloak
247249
- Custom providers
248250
249251
Configuration example:
@@ -271,6 +273,36 @@ spring:
271273
For public OAuth you will need a public hostname and HTTPS enabled. You can use ngrok or Cloudflare tunnels to create a public hostname and tunnel to your local machine during development. You can then use the ngrok hostname in your Google, Facebook and Keycloak developer console configuration.
272274

273275

276+
#### **SSO OIDC with Keycloak**
277+
To enable SSO:
278+
1. Create OIDC client in Keycloak admin console.
279+
2. Update your `application-docker-keycloak.yml`:
280+
```yaml
281+
spring:
282+
security:
283+
oauth2:
284+
client:
285+
registration:
286+
keycloak:
287+
client-id: ${DS_SPRING_USER_KEYCLOAK_CLIENT_ID} # Keycloak client ID for OAuth2
288+
client-secret: ${DS_SPRING_USER_KEYCLOAK_CLIENT_SECRET} # Keycloak client secret for OAuth2
289+
authorization-grant-type: authorization_code # Authorization grant type for OAuth2
290+
scope:
291+
- email # Request email scope for OAuth2
292+
- profile # Request profile scope for OAuth2
293+
- openid # Request oidc scope for OAuth2
294+
client-name: Keycloak # Name of the OAuth2 client
295+
provider: keycloak
296+
provider:
297+
keycloak: # https://www.keycloak.org/securing-apps/oidc-layers
298+
issuer-uri: ${DS_SPRING_USER_KEYCLOAK_PROVIDER_ISSUER_URI}
299+
authorization-uri: ${DS_SPRING_USER_KEYCLOAK_PROVIDER_AUTHORIZATION_URI}
300+
token-uri: ${DS_SPRING_USER_KEYCLOAK_PROVIDER_TOKEN_URI}
301+
user-info-uri: ${DS_SPRING_USER_KEYCLOAK_PROVIDER_USER_INFO_URI}
302+
user-name-attribute: preferred_username # https://www.keycloak.org/docs-api/latest/rest-api/index.html#UserRepresentation
303+
jwk-set-uri: ${DS_SPRING_USER_KEYCLOAK_PROVIDER_JWK_SET_URI}
304+
```
305+
274306
## Extensibility
275307
276308
The framework is designed to be extended without modifying the core code.

0 commit comments

Comments
 (0)