Commit 092a8157 by Juho Juopperi

Fixed bug introduced in 7f68ac52

1 parent 8c3752b4
...@@ -79,16 +79,17 @@ public class BortalLoginModule extends AppservPasswordLoginModule { ...@@ -79,16 +79,17 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
RealmBeanRemote authbean = BortalRealm.getAuthBean(); RealmBeanRemote authbean = BortalRealm.getAuthBean();
if (authbean == null) { if (authbean == null) {
throw new LoginException("Error. Could not get authentication bean!"); throw new LoginException(
"Error. Could not get authentication bean!");
} }
// Authenticate User // Authenticate User
BortalRealm samplerealm = (BortalRealm) _currentRealm; BortalRealm samplerealm = (BortalRealm) _currentRealm;
if (!authbean.authenticate(_username, new String(_password))) { if (!authbean.authenticate(_username, new String(_passwd))) {
// Login fails // Login fails
throw new LoginException((new StringBuilder()) throw new LoginException((new StringBuilder())
.append("customrealm:Login Failed for user ") .append("customrealm:Login Failed for user ")
.append(_username).toString()); .append(_username).toString());
} }
// Login succeeds // Login succeeds
...@@ -100,15 +101,17 @@ public class BortalLoginModule extends AppservPasswordLoginModule { ...@@ -100,15 +101,17 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
try { try {
enumeration = samplerealm.getGroupNames(_username); enumeration = samplerealm.getGroupNames(_username);
} catch (InvalidOperationException invalidoperationexception) { } catch (InvalidOperationException invalidoperationexception) {
throw new LoginException((new StringBuilder()) throw new LoginException(
.append("An InvalidOperationException was thrown " + (new StringBuilder())
" while calling getGroupNames() on the SampleRealm ") .append("An InvalidOperationException was thrown "
.append(invalidoperationexception).toString()); + " while calling getGroupNames() on the SampleRealm ")
.append(invalidoperationexception).toString());
} catch (NoSuchUserException nosuchuserexception) { } catch (NoSuchUserException nosuchuserexception) {
throw new LoginException((new StringBuilder()) throw new LoginException(
.append("A NoSuchUserException was thrown " + (new StringBuilder())
" while calling getGroupNames() on the SampleRealm ") .append("A NoSuchUserException was thrown "
.append(nosuchuserexception).toString()); + " while calling getGroupNames() on the SampleRealm ")
.append(nosuchuserexception).toString());
} }
ArrayList<String> authenticatedGroups = new ArrayList<String>(); ArrayList<String> authenticatedGroups = new ArrayList<String>();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!