Skip to content

Commit

Permalink
adding config for bearerToken
Browse files Browse the repository at this point in the history
  • Loading branch information
dankle committed Oct 6, 2023
1 parent 943a8a9 commit b7825a1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/dist/src/main/resources/concord-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,17 @@ concord-server {
pfed {
enabled = false
priority = 0

bearerToken {
# enable bearer tokens
enableBearerTokens = true

# allow all clientIds
allowAllClientIds = false

# list of allowed pingfed clientids for bearer tokens
allowedClientIds = ["clientId1", "clientId2"]
}
}
authEndpointUrl = "http://auth.example.com/authorize"
tokenEndpointUrl = "http://auth.example.com/token"
Expand All @@ -549,7 +560,7 @@ concord-server {

# enable to validate token signature
tokenSignatureValidation = false

# JSON as a string
#tokenEncryptionKey = "{}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
import javax.inject.Inject;
import java.io.Serializable;
import java.time.Duration;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class SsoConfiguration implements Serializable {

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

@Inject
@Config("sso.pfed.bearerToken.enableBearerTokens")
private boolean enableBearerTokens;

@Inject
@Config("sso.pfed.bearerToken.allowAllClientIds")
private boolean allowAllClientIds;

@Inject
@Nullable
@Config("sso.tokenSigningKey")
Expand Down Expand Up @@ -103,6 +115,10 @@ public class SsoConfiguration implements Serializable {
@Config("sso.autoCreateUsers")
private boolean autoCreateUsers;

@Inject
@Config("sso.pfed.bearerToken.allowedClientIds")
private Set<String> allowedClientIds;

public boolean isAutoCreateUsers() {
return autoCreateUsers;
}
Expand Down Expand Up @@ -135,6 +151,14 @@ public String getClientSecret() {
return clientSecret;
}

public boolean getEnableBearerTokens() {
return enableBearerTokens;
}

public boolean getAllowAllClientIds() {
return allowAllClientIds;
}

public String getTokenEncryptionKey() {
return tokenEncryptionKey;
}
Expand Down Expand Up @@ -170,4 +194,9 @@ public boolean isTokenSignatureValidation() {
public String getUserInfoEndpointUrl() {
return userInfoEndpointUrl;
}

public Set<String> getAllowedClientIds() {
return allowedClientIds;
}

}

0 comments on commit b7825a1

Please sign in to comment.