Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416baebab5 | ||
| 2f38855449 |
@@ -423,3 +423,8 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* Add error logging for user info retrieval in OpenIDConnectService ([861f2f1](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/861f2f1184e860fdd164481167f941c11accfedd))
|
* Add error logging for user info retrieval in OpenIDConnectService ([861f2f1](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/861f2f1184e860fdd164481167f941c11accfedd))
|
||||||
|
## (2026-01-20)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add idClaimName parameter to OpenIDConnectService for flexible ID claim mapping ([2f38855](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/2f388554495d8bd44b4c533baa0f2fc27eea22c2))
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ case class OpenIDProvider(
|
|||||||
authorizationEndpoint: String,
|
authorizationEndpoint: String,
|
||||||
tokenEndpoint: String,
|
tokenEndpoint: String,
|
||||||
userInfoEndpoint: String,
|
userInfoEndpoint: String,
|
||||||
scopes: Set[String] = Set("openid", "profile", "email")
|
scopes: Set[String] = Set("openid", "profile", "email"),
|
||||||
|
idClaimName: String = "id"
|
||||||
)
|
)
|
||||||
|
|
||||||
case class TokenResponse(
|
case class TokenResponse(
|
||||||
@@ -70,7 +71,8 @@ class OpenIDConnectService@Inject(ws: WSClient, config: Configuration)(implicit
|
|||||||
authorizationEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/auth",
|
authorizationEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/auth",
|
||||||
tokenEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/token",
|
tokenEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/token",
|
||||||
userInfoEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/userinfo",
|
userInfoEndpoint = config.get[String]("openid.keycloak.authUrl") + "/protocol/openid-connect/userinfo",
|
||||||
scopes = Set("openid", "profile", "email")
|
scopes = Set("openid", "profile", "email"),
|
||||||
|
idClaimName = "sub"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -136,7 +138,7 @@ class OpenIDConnectService@Inject(ws: WSClient, config: Configuration)(implicit
|
|||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
val json = response.json
|
val json = response.json
|
||||||
Some(OpenIDUserInfo(
|
Some(OpenIDUserInfo(
|
||||||
id = (json \ "id").as[String],
|
id = (json \ provider.idClaimName).as[String],
|
||||||
email = (json \ "email").asOpt[String],
|
email = (json \ "email").asOpt[String],
|
||||||
name = (json \ "name").asOpt[String].orElse((json \ "login").asOpt[String]),
|
name = (json \ "name").asOpt[String].orElse((json \ "login").asOpt[String]),
|
||||||
picture = (json \ "picture").asOpt[String].orElse((json \ "avatar_url").asOpt[String]),
|
picture = (json \ "picture").asOpt[String].orElse((json \ "avatar_url").asOpt[String]),
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=4
|
MAJOR=4
|
||||||
MINOR=46
|
MINOR=47
|
||||||
PATCH=0
|
PATCH=0
|
||||||
|
|||||||
Reference in New Issue
Block a user