edu.internet2.middleware.grouper.ws.security
Class WsGrouperLdapAuthentication

java.lang.Object
  extended by edu.internet2.middleware.grouper.ws.security.WsGrouperLdapAuthentication
All Implemented Interfaces:
WsCustomAuthentication

public class WsGrouperLdapAuthentication
extends Object
implements WsCustomAuthentication

 ldap bind authentication for grouper, settings are specified in grouper-ws.properties, and the grouper-loader.properties
 note: this can be used for rest and soap, though it is not a bastion of security:
  1. for soap, ws-security would be better since a ticket is passed instead of user/pass
  2. for rest, Im not sure there is another option
  3. the user/pass is transmitted in basic auth, so make sure SSL is on
  4. if using proxied web services, the password goes to the middle component
 
 


Constructor Summary
WsGrouperLdapAuthentication()
           
 
Method Summary
static boolean authenticateLdap(String principal, String password)
          see if a user and pass are correct with ldap
static void main(String[] args)
           
 String retrieveLoggedInSubjectId(HttpServletRequest httpServletRequest)
          retrieve the current username (subjectId) from the request object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsGrouperLdapAuthentication

public WsGrouperLdapAuthentication()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Parameters:
args -
Throws:
Exception

retrieveLoggedInSubjectId

public String retrieveLoggedInSubjectId(HttpServletRequest httpServletRequest)
                                 throws RuntimeException
Description copied from interface: WsCustomAuthentication
retrieve the current username (subjectId) from the request object.

Specified by:
retrieveLoggedInSubjectId in interface WsCustomAuthentication
Returns:
the logged in username (subjectId)
Throws:
WsInvalidQueryException - if there is a problem
RuntimeException
See Also:
WsCustomAuthentication.retrieveLoggedInSubjectId(javax.servlet.http.HttpServletRequest)

authenticateLdap

public static boolean authenticateLdap(String principal,
                                       String password)
see if a user and pass are correct with ldap

Parameters:
principal -
password -
Returns:
true for ok, false for not