Skip to content

Commit

Permalink
OIDC : extra query params (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt authored Feb 9, 2024
1 parent 93b4ff7 commit dc1c552
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Configurable properties :
| `oidc.audience` | | Optional : audience to validate. Must be the same as the token's `aud` field |
| `oidc.username-claim` | `preferred_username` | Claim to be used as user id. Must conform to [RFC 1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names) |
| `oidc.groups-claim` | `groups` | Claim to be used as list of user groups. |
| `oidc.extra-query-params` | | Optional : query params to be added by client. e.g : `prompt=consent&kc_idp_hint=google` |

### Security configuration :
| Key | Default | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public AppInfo configuration() {
if (oidcConfiguration != null) {
OIDCConfiguration.setIssuerURI(oidcConfiguration.getIssuerUri());
OIDCConfiguration.setClientID(oidcConfiguration.getClientID());
OIDCConfiguration.setExtraQueryParams(oidcConfiguration.getExtraQueryParams());
appInfo.setOidcConfiguration(OIDCConfiguration);
}
return appInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class OIDCConfiguration {
@Value("${oidc.clientID}")
private String clientID;

@Value("${oidc.extra-query-params}")
private String extraQueryParams;

private final HttpRequestUtils httpRequestUtils;

@Autowired
Expand Down Expand Up @@ -210,6 +213,14 @@ public void setClientID(String clientID) {
this.clientID = clientID;
}

public String getExtraQueryParams() {
return extraQueryParams;
}

public void setExtraQueryParams(String extraQueryParams) {
this.extraQueryParams = extraQueryParams;
}

@Bean
@ConditionalOnProperty(prefix = "oidc", name = "issuer-uri")
NimbusJwtDecoder jwtDecoder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ public static class OIDCConfiguration {
private String issuerURI;
private String clientID;

private String extraQueryParams;

public String getIssuerURI() {
return issuerURI;
}
Expand All @@ -1110,6 +1112,14 @@ public String getClientID() {
public void setClientID(String clientID) {
this.clientID = clientID;
}

public String getExtraQueryParams() {
return extraQueryParams;
}

public void setExtraQueryParams(String extraQueryParams) {
this.extraQueryParams = extraQueryParams;
}
}

public static class Expose {
Expand Down

0 comments on commit dc1c552

Please sign in to comment.