Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenID-Connect-Java-Spring-Server
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
OpenID-Connect-Java-Spring-Server
Commits
0c7ce7f9
Commit
0c7ce7f9
authored
1 year ago
by
Dominik František Bučík
Browse files
Options
Downloads
Plain Diff
chore: merge branch 'dBucik/fix_ga4gh_at_modifier' into 'main'
fix:
Losing AUD in GA4GH AT modifier See merge request
!399
parents
063b15f9
a4656c67
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!399
fix: 🐛 Losing AUD in GA4GH AT modifier
Pipeline
#452967
passed
1 year ago
Stage: .pre
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
perun-oidc-server/src/main/java/cz/muni/ics/oidc/server/ga4gh/Ga4ghAccessTokenModifier.java
+11
-1
11 additions, 1 deletion
.../muni/ics/oidc/server/ga4gh/Ga4ghAccessTokenModifier.java
with
11 additions
and
1 deletion
perun-oidc-server/src/main/java/cz/muni/ics/oidc/server/ga4gh/Ga4ghAccessTokenModifier.java
+
11
−
1
View file @
0c7ce7f9
...
@@ -8,7 +8,10 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -8,7 +8,10 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
import
org.springframework.security.oauth2.provider.OAuth2Authentication
;
import
org.springframework.security.oauth2.provider.OAuth2Authentication
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.Set
;
import
static
cz
.
muni
.
ics
.
oidc
.
server
.
ga4gh
.
Ga4ghApiClaimSource
.
GA4GH_SCOPE
;
import
static
cz
.
muni
.
ics
.
oidc
.
server
.
ga4gh
.
Ga4ghApiClaimSource
.
GA4GH_SCOPE
;
...
@@ -33,8 +36,15 @@ public class Ga4ghAccessTokenModifier implements PerunAccessTokenEnhancer.Access
...
@@ -33,8 +36,15 @@ public class Ga4ghAccessTokenModifier implements PerunAccessTokenEnhancer.Access
Set
<
String
>
scopes
=
accessToken
.
getScope
();
Set
<
String
>
scopes
=
accessToken
.
getScope
();
//GA4GH
//GA4GH
if
(
scopes
.
contains
(
GA4GH_SCOPE
))
{
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"
);
log
.
debug
(
"Adding claims required by GA4GH to access token"
);
builder
.
audience
(
Collections
.
singletonList
(
authentication
.
getOAuth2Request
().
getClientId
()
));
builder
.
audience
(
new
ArrayList
<>(
newAud
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment