Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • perun/perun-proxyidp/v1/OpenID-Connect-Java-Spring-Server
1 result
Show changes
Commits on Source (3)
## [18.5.3](https://gitlab.ics.muni.cz/perun/perun-proxyidp/v1/OpenID-Connect-Java-Spring-Server/compare/v18.5.2...v18.5.3) (2024-05-30)
### Bug Fixes
* 🐛 Losing AUD in GA4GH AT modifier ([a4656c6](https://gitlab.ics.muni.cz/perun/perun-proxyidp/v1/OpenID-Connect-Java-Spring-Server/commit/a4656c6757ee06ab75f9a1185520f208dd158637))
## [18.5.2](https://gitlab.ics.muni.cz/perun/perun-proxyidp/v1/OpenID-Connect-Java-Spring-Server/compare/v18.5.1...v18.5.2) (2024-05-17)
......
......@@ -21,7 +21,7 @@
<parent>
<groupId>cz.muni.ics</groupId>
<artifactId>perun-oidc-parent</artifactId>
<version>18.5.2</version>
<version>18.5.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -22,7 +22,7 @@
<parent>
<groupId>cz.muni.ics</groupId>
<artifactId>perun-oidc-parent</artifactId>
<version>18.5.2</version>
<version>18.5.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -8,7 +8,10 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import static cz.muni.ics.oidc.server.ga4gh.Ga4ghApiClaimSource.GA4GH_SCOPE;
......@@ -33,8 +36,15 @@ public class Ga4ghAccessTokenModifier implements PerunAccessTokenEnhancer.Access
Set<String> scopes = accessToken.getScope();
//GA4GH
if (scopes.contains(GA4GH_SCOPE)) {
Object originalAud = builder.getClaims().get("aud");
Set<String> newAud = new HashSet<>();
if (originalAud instanceof String) {
newAud.add((String) originalAud);
} else if (originalAud instanceof Collection) {
newAud.addAll((Collection<String>) originalAud);
}
log.debug("Adding claims required by GA4GH to access token");
builder.audience(Collections.singletonList(authentication.getOAuth2Request().getClientId()));
builder.audience(new ArrayList<>(newAud));
}
}
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cz.muni.ics</groupId>
<artifactId>perun-oidc-parent</artifactId>
<version>18.5.2</version>
<version>18.5.3</version>
<packaging>pom</packaging>
<modules>
......