Skip to content

Commit

Permalink
Get first value of identity_provider_authnAuthorities for entityId
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeorgilakis-grnet committed Jan 23, 2025
1 parent 61d9661 commit 3a154e5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
For Keycloak upstream changelog please see https://www.keycloak.org/docs/latest/release_notes/index.html.
Full Keycloak upstream jira issue can be shown if filtered by Fix version. For example [Keycloak jira issue for 15.0.2 version](https://issues.redhat.com/browse/KEYCLOAK-19161?jql=project%20%3D%20keycloak%20and%20fixVersion%20%3D%2015.0.2)

## [2.1.0] - 2024-09-23
## [2.3.0] - 2025-01-23

### Changed
- Get first value of identity_provider_authnAuthorities for entityId

## [2.2.1] - 2024-09-24

### Fixed
- Correct GROUP_MEMBERSHIP_CREATE

## [2.2.0] - 2024-09-23

### Changed
- Configured value for voPersonId
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<okhttp.version>4.12.0</okhttp.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<metrics-version>2.2.1</metrics-version>
<metrics-version>2.3.0</metrics-version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ private void setLogin(Event event, RealmModel realm) throws Exception {
if ( this.voPersonId == null)
throw new Exception(userIdentifier + " as userIdentifier does not exist in");
if (event.getDetails().get(MetricsUtils.IDENTITY_PROVIDER_AUTHN_AUTHORITIES) != null) {
AuthnAuthorityRepresentation lastAuthnAuthority = JsonSerialization.readValue(event.getDetails().get(MetricsUtils.IDENTITY_PROVIDER_AUTHN_AUTHORITIES),new TypeReference<LinkedList<AuthnAuthorityRepresentation>>(){}).getLast();
this.entityId = lastAuthnAuthority.getId();
this.idpName = lastAuthnAuthority.getName();
AuthnAuthorityRepresentation firstAuthnAuthority = JsonSerialization.readValue(event.getDetails().get(MetricsUtils.IDENTITY_PROVIDER_AUTHN_AUTHORITIES),new TypeReference<LinkedList<AuthnAuthorityRepresentation>>(){}).getFirst();
this.entityId = firstAuthnAuthority.getId();
this.idpName = firstAuthnAuthority.getName();
} else if (event.getDetails().get(MetricsUtils.AUTHN_AUTHORITY) != null) {
//authnAuthority of IdP in user session note (name = identity_provider_id)
this.entityId = event.getDetails().get(MetricsUtils.AUTHN_AUTHORITY);
Expand Down

0 comments on commit 3a154e5

Please sign in to comment.