summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-09-20 13:10:16 +0200
committerSimon Rettberg2019-09-20 13:10:16 +0200
commitf270b9364035cd2c3312bf90cf8b007e2ed73adc (patch)
tree4f5af92fee7d23702fa2da998358b61d08e851a4
parent[server] Fix: Don't use deprecated methods from FileUtils (diff)
downloadtutor-module-f270b9364035cd2c3312bf90cf8b007e2ed73adc.tar.gz
tutor-module-f270b9364035cd2c3312bf90cf8b007e2ed73adc.tar.xz
tutor-module-f270b9364035cd2c3312bf90cf8b007e2ed73adc.zip
[client] Don't chop off @org suffix from user name
What was meant to help if users add their org to the username out of habit actually breaks things in places where this is required. Instead move this logic to the authenticator that would from now on chop off any @org suffix if authentication with the verbatim username fails.
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java1
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java30
2 files changed, 2 insertions, 29 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java
index 071b92ad..1c6062b6 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java
@@ -132,6 +132,7 @@ public class ShibbolethEcp {
// now init the authenticator for that idp and our static sp
final ECPAuthenticator auth = new ECPAuthenticator(ProxyConfigurator.getClient(), user, pass, new URI(idpUrl), BWLP_SP);
+ auth.setRetryWithoutAt(true);
HttpResponse spResponse;
try {
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
index 87524764..8f5dc68a 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
@@ -200,7 +200,7 @@ public class LoginWindow extends LoginWindowLayout {
txtUsername.getDocument().addDocumentListener(new TextChangeListener() {
@Override
public void changed() {
- if (cboOrganization.getSelectedIndex() != -1)
+ if (cboOrganization.getSelectedIndex() != -1 || loginType != LoginType.ECP)
return;
String name = txtUsername.getText();
int at = name.indexOf('@');
@@ -303,34 +303,6 @@ public class LoginWindow extends LoginWindowLayout {
// determine which organization was selected by the user.
Organization selectedOrg = cboOrganization.getItemAt(cboOrganization.getSelectedIndex());
- // now lets check if the username contains an organization
- // for this we just check if the given username contains a '@'
- // if it does, we just strip everything after and including '@'
- if (loginType == LoginType.ECP && username.contains("@")) {
- // split only on first occurence of '@'
- String[] usernameSplit = username.split("@", 2);
- if (!usernameSplit[1].isEmpty()) {
- Organization orgInUsername = OrganizationCache.find(usernameSplit[1]);
- if (orgInUsername != null) {
- // username contains a known organization
- if (!selectedOrg.equals(orgInUsername)) {
- // but it does not match the one selected in the combobox
- boolean ret = Gui.showMessageBox(
- this,
- "Der angegebene Benutzername enthält eine Organisation, die nicht mit Ihrer IDP-Auswahl übereinstimmt."
- + "\nWollen Sie die in Ihrem Benutzername gefundene Organisation verwenden?",
- MessageType.QUESTION_YESNO, null, null);
- if (ret) {
- cboOrganization.setSelectedItem(orgInUsername);
- selectedOrg = orgInUsername;
- }
- }
- // always set the username to everything before '@'
- txtUsername.setText(usernameSplit[0]);
- username = usernameSplit[0];
- }
- }
- }
// we are doing the login soon, first save the config
doSaveConfig();