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 1 commit
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-params` | | Optional : map of params to be used by client. e.g : `{ kc_locale: 'fr', kc_idp_hint: 'google'}` |
olevitt marked this conversation as resolved.
Show resolved Hide resolved

### Security configuration :
| Key | Default | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import fr.insee.onyxia.api.services.utils.HttpRequestUtils;
import fr.insee.onyxia.model.User;
import fr.insee.onyxia.model.region.Region;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -60,6 +62,8 @@ public class OIDCConfiguration {

private final HttpRequestUtils httpRequestUtils;

private Map<String, String> extraParams = new HashMap<>();

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

public Map<String, String> getExtraParams() {
return extraParams;
}

public void setExtraParams(Map<String, String> extraParams) {
this.extraParams = extraParams;
}

@Bean
@ConditionalOnProperty(prefix = "oidc", name = "issuer-uri")
NimbusJwtDecoder jwtDecoder() {
Expand Down