Skip to content

Commit b7825a1

Browse files
committed
adding config for bearerToken
1 parent 943a8a9 commit b7825a1

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

server/dist/src/main/resources/concord-server.conf

+12-1
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,17 @@ concord-server {
533533
pfed {
534534
enabled = false
535535
priority = 0
536+
537+
bearerToken {
538+
# enable bearer tokens
539+
enableBearerTokens = true
540+
541+
# allow all clientIds
542+
allowAllClientIds = false
543+
544+
# list of allowed pingfed clientids for bearer tokens
545+
allowedClientIds = ["clientId1", "clientId2"]
546+
}
536547
}
537548
authEndpointUrl = "http://auth.example.com/authorize"
538549
tokenEndpointUrl = "http://auth.example.com/token"
@@ -549,7 +560,7 @@ concord-server {
549560

550561
# enable to validate token signature
551562
tokenSignatureValidation = false
552-
563+
553564
# JSON as a string
554565
#tokenEncryptionKey = "{}"
555566

server/plugins/pfed-sso/src/main/java/com/walmartlabs/concord/server/plugins/pfedsso/SsoConfiguration.java

+29
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
import javax.inject.Inject;
2727
import java.io.Serializable;
2828
import java.time.Duration;
29+
import java.util.Collections;
30+
import java.util.HashSet;
31+
import java.util.List;
32+
import java.util.Set;
2933

3034
public class SsoConfiguration implements Serializable {
3135

@@ -63,6 +67,14 @@ public class SsoConfiguration implements Serializable {
6367
@Config("sso.clientSecret")
6468
private String clientSecret;
6569

70+
@Inject
71+
@Config("sso.pfed.bearerToken.enableBearerTokens")
72+
private boolean enableBearerTokens;
73+
74+
@Inject
75+
@Config("sso.pfed.bearerToken.allowAllClientIds")
76+
private boolean allowAllClientIds;
77+
6678
@Inject
6779
@Nullable
6880
@Config("sso.tokenSigningKey")
@@ -103,6 +115,10 @@ public class SsoConfiguration implements Serializable {
103115
@Config("sso.autoCreateUsers")
104116
private boolean autoCreateUsers;
105117

118+
@Inject
119+
@Config("sso.pfed.bearerToken.allowedClientIds")
120+
private Set<String> allowedClientIds;
121+
106122
public boolean isAutoCreateUsers() {
107123
return autoCreateUsers;
108124
}
@@ -135,6 +151,14 @@ public String getClientSecret() {
135151
return clientSecret;
136152
}
137153

154+
public boolean getEnableBearerTokens() {
155+
return enableBearerTokens;
156+
}
157+
158+
public boolean getAllowAllClientIds() {
159+
return allowAllClientIds;
160+
}
161+
138162
public String getTokenEncryptionKey() {
139163
return tokenEncryptionKey;
140164
}
@@ -170,4 +194,9 @@ public boolean isTokenSignatureValidation() {
170194
public String getUserInfoEndpointUrl() {
171195
return userInfoEndpointUrl;
172196
}
197+
198+
public Set<String> getAllowedClientIds() {
199+
return allowedClientIds;
200+
}
201+
173202
}

0 commit comments

Comments
 (0)