Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC : extra params #378

Merged
merged 5 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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