Skip to content
Snippets Groups Projects
Commit feb6355e authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 12.1 to OpenOLAT default branch with d42b30984bcf855d3935f95da2418f43854a016b

parents ec54a396 9e5ff8ce
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 4 deletions
...@@ -990,7 +990,7 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Persi ...@@ -990,7 +990,7 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Persi
public void incrementUserAttempts(UserCourseEnvironment userCourseEnv, Role by) { public void incrementUserAttempts(UserCourseEnvironment userCourseEnv, Role by) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager(); AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
Identity assessedIdentity = userCourseEnv.getIdentityEnvironment().getIdentity(); Identity assessedIdentity = userCourseEnv.getIdentityEnvironment().getIdentity();
am.updateLastModifications(this, assessedIdentity, userCourseEnv, by); am.incrementNodeAttempts(this, assessedIdentity, userCourseEnv, by);
} }
@Override @Override
......
...@@ -63,6 +63,7 @@ public class OAuthLoginModule extends AbstractSpringModule { ...@@ -63,6 +63,7 @@ public class OAuthLoginModule extends AbstractSpringModule {
private boolean adfsEnabled; private boolean adfsEnabled;
private boolean adfsRootEnabled; private boolean adfsRootEnabled;
private String adfsApiKey; private String adfsApiKey;
private String adfsApiSecret;
private String adfsOAuth2Endpoint; private String adfsOAuth2Endpoint;
private boolean openIdConnectIFEnabled; private boolean openIdConnectIFEnabled;
...@@ -128,6 +129,7 @@ public class OAuthLoginModule extends AbstractSpringModule { ...@@ -128,6 +129,7 @@ public class OAuthLoginModule extends AbstractSpringModule {
String adfsRootEnabledObj = getStringPropertyValue("adfsRootEnabled", true); String adfsRootEnabledObj = getStringPropertyValue("adfsRootEnabled", true);
adfsRootEnabled = "true".equals(adfsRootEnabledObj); adfsRootEnabled = "true".equals(adfsRootEnabledObj);
adfsApiKey = getStringPropertyValue("adfsApiKey", false); adfsApiKey = getStringPropertyValue("adfsApiKey", false);
adfsApiSecret = getStringPropertyValue("adfsApiSecret", false);
adfsOAuth2Endpoint = getStringPropertyValue("adfsOAuth2Endpoint", false); adfsOAuth2Endpoint = getStringPropertyValue("adfsOAuth2Endpoint", false);
String openIdConnectIFEnabledObj = getStringPropertyValue("openIdConnectIFEnabled", true); String openIdConnectIFEnabledObj = getStringPropertyValue("openIdConnectIFEnabled", true);
...@@ -407,6 +409,15 @@ public class OAuthLoginModule extends AbstractSpringModule { ...@@ -407,6 +409,15 @@ public class OAuthLoginModule extends AbstractSpringModule {
this.adfsApiKey = adfsApiKey; this.adfsApiKey = adfsApiKey;
setStringProperty("adfsApiKey", adfsApiKey, true); setStringProperty("adfsApiKey", adfsApiKey, true);
} }
public String getAdfsApiSecret() {
return adfsApiSecret;
}
public void setAdfsApiSecret(String adfsApiSecret) {
this.adfsApiSecret = adfsApiSecret;
setStringProperty("adfsApiSecret", adfsApiSecret, true);
}
public String getAdfsOAuth2Endpoint() { public String getAdfsOAuth2Endpoint() {
return adfsOAuth2Endpoint; return adfsOAuth2Endpoint;
......
...@@ -93,8 +93,8 @@ public class ADFSApi extends DefaultApi20 { ...@@ -93,8 +93,8 @@ public class ADFSApi extends DefaultApi20 {
private static final String GRANT_TYPE_AUTHORIZATION_CODE = "authorization_code"; private static final String GRANT_TYPE_AUTHORIZATION_CODE = "authorization_code";
private static final String GRANT_TYPE = "grant_type"; private static final String GRANT_TYPE = "grant_type";
private final ADFSApi api; private final ADFSApi api;
private OAuthConfig config; private OAuthConfig config;
public ADFSOAuth2Service(ADFSApi api, OAuthConfig config) { public ADFSOAuth2Service(ADFSApi api, OAuthConfig config) {
super(api, config); super(api, config);
......
...@@ -89,7 +89,8 @@ public class ADFSProvider implements OAuthSPI { ...@@ -89,7 +89,8 @@ public class ADFSProvider implements OAuthSPI {
@Override @Override
public String getAppSecret() { public String getAppSecret() {
return "n/A"; return StringHelper.containsNonWhitespace(oauthModule.getAdfsApiSecret())
? oauthModule.getAdfsApiSecret() : "n/A";
} }
@Override @Override
......
...@@ -79,6 +79,7 @@ public class OAuthAdminController extends FormBasicController { ...@@ -79,6 +79,7 @@ public class OAuthAdminController extends FormBasicController {
private MultipleSelectionElement adfsEl; private MultipleSelectionElement adfsEl;
private MultipleSelectionElement adfsDefaultEl; private MultipleSelectionElement adfsDefaultEl;
private TextElement adfsApiKeyEl; private TextElement adfsApiKeyEl;
private TextElement adfsApiSecretEl;
private TextElement adfsOAuth2EndpointEl; private TextElement adfsOAuth2EndpointEl;
private MultipleSelectionElement openIdConnectIFEl; private MultipleSelectionElement openIdConnectIFEl;
...@@ -217,10 +218,15 @@ public class OAuthAdminController extends FormBasicController { ...@@ -217,10 +218,15 @@ public class OAuthAdminController extends FormBasicController {
String adfsApiKey = oauthModule.getAdfsApiKey(); String adfsApiKey = oauthModule.getAdfsApiKey();
adfsApiKeyEl = uifactory.addTextElement("adfs.id", "adfs.api.id", 256, adfsApiKey, adfsCont); adfsApiKeyEl = uifactory.addTextElement("adfs.id", "adfs.api.id", 256, adfsApiKey, adfsCont);
String adfsApiSecret = oauthModule.getAdfsApiSecret();
adfsApiSecretEl = uifactory.addTextElement("adfs.secret", "adfs.api.secret", 256, adfsApiSecret, adfsCont);
adfsApiSecretEl.setHelpText("adfs.api.secret.hint");
if(oauthModule.isAdfsEnabled()) { if(oauthModule.isAdfsEnabled()) {
adfsEl.select(keys[0], true); adfsEl.select(keys[0], true);
} else { } else {
adfsApiKeyEl.setVisible(false); adfsApiKeyEl.setVisible(false);
adfsApiSecretEl.setVisible(false);
adfsDefaultEl.setVisible(false); adfsDefaultEl.setVisible(false);
adfsOAuth2EndpointEl.setVisible(false); adfsOAuth2EndpointEl.setVisible(false);
} }
...@@ -399,6 +405,7 @@ public class OAuthAdminController extends FormBasicController { ...@@ -399,6 +405,7 @@ public class OAuthAdminController extends FormBasicController {
facebookApiSecretEl.setVisible(facebookEl.isAtLeastSelected(1)); facebookApiSecretEl.setVisible(facebookEl.isAtLeastSelected(1));
} else if(source == adfsEl) { } else if(source == adfsEl) {
adfsApiKeyEl.setVisible(adfsEl.isAtLeastSelected(1)); adfsApiKeyEl.setVisible(adfsEl.isAtLeastSelected(1));
adfsApiSecretEl.setVisible(adfsEl.isAtLeastSelected(1));
adfsDefaultEl.setVisible(adfsEl.isAtLeastSelected(1)); adfsDefaultEl.setVisible(adfsEl.isAtLeastSelected(1));
adfsOAuth2EndpointEl.setVisible(adfsEl.isAtLeastSelected(1)); adfsOAuth2EndpointEl.setVisible(adfsEl.isAtLeastSelected(1));
} else if(source == openIdConnectIFEl) { } else if(source == openIdConnectIFEl) {
...@@ -466,11 +473,13 @@ public class OAuthAdminController extends FormBasicController { ...@@ -466,11 +473,13 @@ public class OAuthAdminController extends FormBasicController {
if(adfsEl.isAtLeastSelected(1)) { if(adfsEl.isAtLeastSelected(1)) {
oauthModule.setAdfsEnabled(true); oauthModule.setAdfsEnabled(true);
oauthModule.setAdfsApiKey(adfsApiKeyEl.getValue()); oauthModule.setAdfsApiKey(adfsApiKeyEl.getValue());
oauthModule.setAdfsApiSecret(adfsApiSecretEl.getValue());
oauthModule.setAdfsRootEnabled(adfsDefaultEl.isAtLeastSelected(1)); oauthModule.setAdfsRootEnabled(adfsDefaultEl.isAtLeastSelected(1));
oauthModule.setAdfsOAuth2Endpoint(adfsOAuth2EndpointEl.getValue()); oauthModule.setAdfsOAuth2Endpoint(adfsOAuth2EndpointEl.getValue());
} else { } else {
oauthModule.setAdfsEnabled(false); oauthModule.setAdfsEnabled(false);
oauthModule.setAdfsApiKey(""); oauthModule.setAdfsApiKey("");
oauthModule.setAdfsApiSecret("");
oauthModule.setAdfsRootEnabled(false); oauthModule.setAdfsRootEnabled(false);
oauthModule.setAdfsOAuth2Endpoint(""); oauthModule.setAdfsOAuth2Endpoint("");
} }
......
...@@ -3,6 +3,8 @@ add.openidconnectif.custom=Custom Open ID Connect erstellen ...@@ -3,6 +3,8 @@ add.openidconnectif.custom=Custom Open ID Connect erstellen
adfs.admin.title=Active directory federation system adfs.admin.title=Active directory federation system
adfs.admin.title.alt=Active directory federation system adfs.admin.title.alt=Active directory federation system
adfs.api.id=Client ID adfs.api.id=Client ID
adfs.api.secret=Client secret
adfs.api.secret.hint=Nur f\u00FCr ADFS 2016
adfs.default.enabled=Automatische Umleitung (Lokaler Login \u00FCber /maintenance/) adfs.default.enabled=Automatische Umleitung (Lokaler Login \u00FCber /maintenance/)
adfs.enabled=ADFS adfs.enabled=ADFS
adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint) adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint)
......
...@@ -3,6 +3,8 @@ add.openidconnectif.custom=Add custom Open ID Connect ...@@ -3,6 +3,8 @@ add.openidconnectif.custom=Add custom Open ID Connect
adfs.admin.title=Active directory federation system adfs.admin.title=Active directory federation system
adfs.admin.title.alt=Active directory federation system adfs.admin.title.alt=Active directory federation system
adfs.api.id=Client ID adfs.api.id=Client ID
adfs.api.secret=Client secret
adfs.api.secret.hint=Only for ADFS 2016
adfs.default.enabled=Automatic redirect (local login via /maintenance) adfs.default.enabled=Automatic redirect (local login via /maintenance)
adfs.enabled=ADFS adfs.enabled=ADFS
adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint) adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint)
......
...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Ajouter un Open ID Connect personnalis\u00E9 ...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Ajouter un Open ID Connect personnalis\u00E9
adfs.admin.title=Active directory federation system adfs.admin.title=Active directory federation system
adfs.admin.title.alt=Active directory federation system adfs.admin.title.alt=Active directory federation system
adfs.api.id=ID client adfs.api.id=ID client
adfs.api.secret=Secret client
adfs.default.enabled=Login au niveau racine ( redirig\u00E9 dmz ) adfs.default.enabled=Login au niveau racine ( redirig\u00E9 dmz )
adfs.enabled=ADFS adfs.enabled=ADFS
adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint) adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint)
......
...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Aggiungere Open ID Connect personalizzato ...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Aggiungere Open ID Connect personalizzato
adfs.admin.title=Active directory federation system adfs.admin.title=Active directory federation system
adfs.admin.title.alt=Active directory federation system adfs.admin.title.alt=Active directory federation system
adfs.api.id=Client ID adfs.api.id=Client ID
adfs.api.secret=Client secret
adfs.default.enabled=Root login (redirezione dmz) adfs.default.enabled=Root login (redirezione dmz)
adfs.enabled=ADFS adfs.enabled=ADFS
adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint) adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint)
......
...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Adicionar Open ID Connect personalizado ...@@ -3,6 +3,7 @@ add.openidconnectif.custom=Adicionar Open ID Connect personalizado
adfs.admin.title=Sistema federativo de diret\u00F3rio ativo adfs.admin.title=Sistema federativo de diret\u00F3rio ativo
adfs.admin.title.alt=Sistema federativo de diret\u00F3rio ativo adfs.admin.title.alt=Sistema federativo de diret\u00F3rio ativo
adfs.api.id=Client ID adfs.api.id=Client ID
adfs.api.secret=Client secret
adfs.default.enabled=Root login (redirect dmz) adfs.default.enabled=Root login (redirect dmz)
adfs.enabled=ADFS adfs.enabled=ADFS
adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint) adfs.oauth2.endpoint=OAuth2 endpoint (oAuthEndpoint)
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment