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
Commits
6c3b3699
Commit
6c3b3699
authored
4 years ago
by
Wylem Bars
Browse files
Options
Downloads
Patches
Plain Diff
IUAINFRA-53 | Add aerne to the Token Generator available subjects
parent
33f4aa8f
No related branches found
No related tags found
1 merge request
!4
Feature/iuainfra 53
Pipeline
#166233
failed
4 years ago
Stage: build
Stage: tests
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
access-token-provider-api/src/main/java/net/ihe/gazelle/app/accesstokenproviderapi/application/TokenGenerator.java
+4
-1
4 additions, 1 deletion
...pp/accesstokenproviderapi/application/TokenGenerator.java
with
4 additions
and
1 deletion
access-token-provider-api/src/main/java/net/ihe/gazelle/app/accesstokenproviderapi/application/TokenGenerator.java
+
4
−
1
View file @
6c3b3699
...
...
@@ -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"
);
}
...
...
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