Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Access Token Provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Gazelle
Applications
Test execution
Simulator
Access Token Provider
Merge requests
!4
Feature/iuainfra 53
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/iuainfra 53
feature/IUAINFRA-53
into
develop
Overview
0
Commits
4
Pipelines
2
Changes
1
Merged
Wylem Bars
requested to merge
feature/IUAINFRA-53
into
develop
4 years ago
Overview
0
Commits
4
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
6c3b3699
Prev
Next
Show latest version
1 file
+
4
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
6c3b3699
IUAINFRA-53 | Add aerne to the Token Generator available subjects
· 6c3b3699
Wylem Bars
authored
4 years ago
access-token-provider-api/src/main/java/net/ihe/gazelle/app/accesstokenproviderapi/application/TokenGenerator.java
+
4
−
1
Options
@@ -19,6 +19,8 @@ import java.nio.charset.StandardCharsets;
import
java.time.Duration
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.UUID
;
/**
@@ -30,6 +32,7 @@ public class TokenGenerator {
private
static
final
String
ISSUER
=
"https://ehealthsuisse.ihe-europe.net/access-token-provider"
;
private
static
final
TokenType
TOKEN_TYPE
=
TokenType
.
JWT
;
private
static
final
Duration
DEFAULT_DURATION
=
Duration
.
ofMinutes
(
5
);
private
static
final
List
<
String
>
SUBJECTS
=
Arrays
.
asList
(
"aamrein"
,
"aerne"
);
private
AudienceSecretRetriever
audienceSecretRetriever
;
@@ -73,7 +76,7 @@ public class TokenGenerator {
throw
new
TokenRequestException
(
"Audience is null or empty"
);
}
if
(
accessTokenRequest
.
getSubject
()
==
null
||
!
accessTokenRequest
.
getSubject
()
.
equals
(
"aamrein"
))
{
if
(
accessTokenRequest
.
getSubject
()
==
null
||
!
SUBJECTS
.
contains
(
accessTokenRequest
.
getSubject
()))
{
throw
new
TokenRequestException
(
"Unsupported subject"
);
}
Loading