Commit 1da935f2 by Juho Juopperi

use crypto libs

1 parent 96e8c078
...@@ -38,6 +38,8 @@ package fi.insomnia.bortal; ...@@ -38,6 +38,8 @@ package fi.insomnia.bortal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import javax.security.auth.login.LoginException; import javax.security.auth.login.LoginException;
...@@ -79,6 +81,9 @@ public class BortalLoginModule extends AppservPasswordLoginModule { ...@@ -79,6 +81,9 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
throw new LoginException("Realm not SampleRealm"); throw new LoginException("Realm not SampleRealm");
} }
// find cert
log("Trying to find certificates");
RealmBeanRemote authbean = BortalRealm.getAuthBean(); RealmBeanRemote authbean = BortalRealm.getAuthBean();
if (authbean == null) { if (authbean == null) {
throw new LoginException( throw new LoginException(
...@@ -105,14 +110,14 @@ public class BortalLoginModule extends AppservPasswordLoginModule { ...@@ -105,14 +110,14 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
} catch (InvalidOperationException invalidoperationexception) { } catch (InvalidOperationException invalidoperationexception) {
throw new LoginException( throw new LoginException(
(new StringBuilder()) (new StringBuilder())
.append("An InvalidOperationException was thrown " .append("An InvalidOperationException was thrown ")
).append(" while calling getGroupNames() on the SampleRealm ") .append(" while calling getGroupNames() on the SampleRealm ")
.append(invalidoperationexception).toString()); .append(invalidoperationexception).toString());
} catch (NoSuchUserException nosuchuserexception) { } catch (NoSuchUserException nosuchuserexception) {
throw new LoginException( throw new LoginException(
(new StringBuilder()) (new StringBuilder())
.append("A NoSuchUserException was thrown " .append("A NoSuchUserException was thrown ")
).append(" while calling getGroupNames() on the SampleRealm ") .append(" while calling getGroupNames() on the SampleRealm ")
.append(nosuchuserexception).toString()); .append(nosuchuserexception).toString());
} }
ArrayList<String> authenticatedGroups = new ArrayList<String>(); ArrayList<String> authenticatedGroups = new ArrayList<String>();
...@@ -124,18 +129,18 @@ public class BortalLoginModule extends AppservPasswordLoginModule { ...@@ -124,18 +129,18 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
} }
// Call commitUserAuthentication with the groupNames the user belongs to // Call commitUserAuthentication with the groupNames the user belongs to
String[] groups = authenticatedGroups.toArray(new String[authenticatedGroups.size()]); String[] groups = authenticatedGroups
.toArray(new String[authenticatedGroups.size()]);
// System.out.println("groups: " + groups.length); // System.out.println("groups: " + groups.length);
// for (String str : groups) { // for (String str : groups) {
// System.out.println("Str " + str); // System.out.println("Str " + str);
// } // }
commitUserAuthentication(groups); commitUserAuthentication(groups);
} }
private void log(String s) { private void log(String s) {
System.out.println((new StringBuilder()) System.out.println((new StringBuilder()).append("BortalLoginModule::")
.append("BortalLoginModule::").append(s).toString()); .append(s).toString());
} }
} }
Manifest-Version: 1.0 Manifest-Version: 1.0
Class-Path: lib/LanBortalUtilities.jar Class-Path: lib/LanBortalUtilities.jar
bcprov-jdk16-146.jar
bcmail-jdk16-146.jar
...@@ -114,6 +114,9 @@ ...@@ -114,6 +114,9 @@
<auth-constraint> <auth-constraint>
<description>Thou shall not read the sources or use utils directly</description> <description>Thou shall not read the sources or use utils directly</description>
</auth-constraint> </auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint> </security-constraint>
<servlet> <servlet>
<description></description> <description></description>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!