- try {
- String clientName = gssContext.getSrcName().toString();
- String role = clientName.substring(clientName.indexOf('@') + 1);
-
- log.debug("SpnegoUserRealm: established a security context");
- log.debug("Client Principal is: " + gssContext.getSrcName());
- log.debug("Server Principal is: " + gssContext.getTargName());
- log.debug("Client Default Role: " + role);
- } catch (GSSException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ else {
+// if (!sharedState.containsKey(CmsAuthUtils.SHARED_STATE_NAME)) {
+// try {
+// GSSName name = gssContext.getSrcName();
+// String username = name.toString();
+// // TODO deal with connecting service
+// // TODO generate IPA DN?
+// username = username.substring(0, username.lastIndexOf('@'));
+// sharedState.put(CmsAuthUtils.SHARED_STATE_NAME, username);
+// } catch (GSSException e) {
+// throw new IllegalStateException("Cannot retrieve SPNEGO name", e);
+// }
+// }
+ return true;