Skip to content

Commit 643e941

Browse files
authored
OIDC : cleanup & add idleSessionLifetimeInSeconds (#570)
1 parent 725331b commit 643e941

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Configurable properties :
7272
| `oidc.public-key` | | Optional: If for some reason you don't want Onyxia-API to bootstrap configuration by requesting the `issuer-uri` then you can manually provide the public key used for validating incoming tokens. |
7373
| `oidc.extra-query-params` | | Optional : query params to be added by client. e.g : `prompt=consent&kc_idp_hint=google` |
7474
| `oidc.scope` | `openid profile` | Optional : Specifies the OIDC scopes to be requested by the Onyxia client. `"openid"` is always requested, regardless of this setting. |
75-
| `oidc.workaroundForGoogleClientSecret` | | For some reasons, Google OAuth requires providing a client secret even for public clients. ⚠️ Use this configuration only if using Google OAuth ! ⚠️ For all other providers you should not have client secret as the Onyxia client is public. Example client secret format: " `GOCSPX-_xxxxxxxxxxxxxxxxxxxxxxxxxxx` |
75+
| `oidc.idleSessionLifetimeInSeconds` | | Optional: Automatically logs out users after a set period of inactivity. |
7676

7777
### Security configuration :
7878
| Key | Default | Description |

onyxia-api/src/main/java/fr/insee/onyxia/api/controller/pub/ConfigurationController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public AppInfo configuration() {
5454
OIDCConfiguration.setIssuerURI(oidcConfiguration.getIssuerUri());
5555
OIDCConfiguration.setClientID(oidcConfiguration.getClientID());
5656
OIDCConfiguration.setExtraQueryParams(oidcConfiguration.getExtraQueryParams());
57-
OIDCConfiguration.setWorkaroundForGoogleClientSecret(
58-
oidcConfiguration.getWorkaroundForGoogleClientSecret());
57+
OIDCConfiguration.setIdleSessionLifetimeInSeconds(
58+
oidcConfiguration.getIdleSessionLifetimeInSeconds());
5959
OIDCConfiguration.setScope(oidcConfiguration.getScope());
6060
OIDCConfiguration.setAudience(oidcConfiguration.getAudience());
6161
appInfo.setOidcConfiguration(OIDCConfiguration);

onyxia-api/src/main/java/fr/insee/onyxia/api/security/OIDCConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public class OIDCConfiguration {
9494
@Value("${oidc.scope}")
9595
private String scope;
9696

97-
@Value("${oidc.workaroundForGoogleClientSecret}")
98-
private String workaroundForGoogleClientSecret;
97+
@Value("${oidc.idleSessionLifetimeInSeconds}")
98+
private Integer idleSessionLifetimeInSeconds;
9999

100100
private final HttpRequestUtils httpRequestUtils;
101101

@@ -288,12 +288,12 @@ public void setScope(String scope) {
288288
this.scope = scope;
289289
}
290290

291-
public void setWorkaroundForGoogleClientSecret(String workaroundForGoogleClientSecret) {
292-
this.workaroundForGoogleClientSecret = workaroundForGoogleClientSecret;
291+
public void setIdleSessionLifetimeInSeconds(Integer idleSessionLifetimeInSeconds) {
292+
this.idleSessionLifetimeInSeconds = idleSessionLifetimeInSeconds;
293293
}
294294

295-
public String getWorkaroundForGoogleClientSecret() {
296-
return workaroundForGoogleClientSecret;
295+
public Integer getIdleSessionLifetimeInSeconds() {
296+
return idleSessionLifetimeInSeconds;
297297
}
298298

299299
@Bean

onyxia-api/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ oidc.groups-claim=groups
1111
oidc.roles-claim=roles
1212
oidc.extra-query-params=
1313
oidc.scope=openid profile
14-
oidc.workaroundForGoogleClientSecret=
14+
oidc.idleSessionLifetimeInSeconds=
1515
# Catalogs
1616
catalogs.refresh.ms=300000
1717
# Security

onyxia-model/src/main/java/fr/insee/onyxia/model/region/Region.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ public static class OIDCConfiguration {
787787
private String clientID;
788788
private String extraQueryParams;
789789
private String scope;
790-
private String workaroundForGoogleClientSecret;
790+
private Integer idleSessionLifetimeInSeconds;
791791

792792
private String audience;
793793

@@ -815,12 +815,12 @@ public void setExtraQueryParams(String extraQueryParams) {
815815
this.extraQueryParams = extraQueryParams;
816816
}
817817

818-
public String getWorkaroundForGoogleClientSecret() {
819-
return workaroundForGoogleClientSecret;
818+
public Integer getIdleSessionLifetimeInSeconds() {
819+
return idleSessionLifetimeInSeconds;
820820
}
821821

822-
public void setWorkaroundForGoogleClientSecret(String workaroundForGoogleClientSecret) {
823-
this.workaroundForGoogleClientSecret = workaroundForGoogleClientSecret;
822+
public void setIdleSessionLifetimeInSeconds(Integer idleSessionLifetimeInSeconds) {
823+
this.idleSessionLifetimeInSeconds = idleSessionLifetimeInSeconds;
824824
}
825825

826826
public String getScope() {

0 commit comments

Comments
 (0)