-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from kurzdigital/locale
Add locale as KeycloakUser attribute
- Loading branch information
Showing
5 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ public final class KeycloakUser { | |
private final String firstName; | ||
private final String lastName; | ||
private final String email; | ||
private final String locale; | ||
private final List<String> groups; | ||
private final List<String> roles; | ||
// ... | ||
|
@@ -53,6 +54,7 @@ KeycloakUser user = KeycloakUser.builder() | |
.firstName("Mister") | ||
.lastName("Test") | ||
.email("[email protected]") | ||
.locale("en") | ||
.userName("test") | ||
.groups(Arrays.asList("USER")) | ||
.build(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/kurzdigital/keycloak/UnsupportedLocaleException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.kurzdigital.keycloak; | ||
|
||
import java.util.Set; | ||
|
||
public class UnsupportedLocaleException extends RuntimeException { | ||
|
||
public UnsupportedLocaleException(Set<String> supportedLocales) { | ||
super("Given locale is not supported. Supported locales: " + supportedLocales); | ||
} | ||
} |