Package edu.vt.middleware.ldap.ed
Interface EdAuthService
-
- All Superinterfaces:
EdOperation
public interface EdAuthService extends EdOperation
Add facilities for authentication and authorization to ED clients.- Author:
- Middleware Services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.ldaptive.LdapEntryauthenticate(String user, org.ldaptive.Credential credential, String... attributes)This will attempt to authenticate a user against ED-Auth.voidauthorize(org.ldaptive.LdapEntry entry, String authorizationExpression)This will attempt to authorize a user's givenLdapEntryvia the provided authorizationExpression.String[]getAffiliations(org.ldaptive.LdapEntry authResult)This returns all the affiliations for the supplied entry.String[]getGroupMembership(org.ldaptive.LdapEntry authResult)This returns all the group memberships for the supplied entry.VirginiaTechPersongetVirginiaTechPerson(org.ldaptive.LdapEntry authResult)This will attempt to mapLdapEntryto aVirginiaTechPersonbean.-
Methods inherited from interface edu.vt.middleware.ldap.ed.EdOperation
getConnectionFactory, getEnvironment, getType
-
-
-
-
Method Detail
-
authenticate
org.ldaptive.LdapEntry authenticate(String user, org.ldaptive.Credential credential, String... attributes) throws org.ldaptive.LdapException
This will attempt to authenticate a user against ED-Auth. User should correspond to uupid. Once this method has been called the connection to the LDAP is closed.- Parameters:
user- username for bindcredential- credential for bindattributes- attributes to retrieve (ieEdContext.ALL_ATTR,EdContext.AFFILIATION_ATTR, ...)- Returns:
- Found
LdapEntry - Throws:
org.ldaptive.LdapException- if the authentication fails for any reason
-
authorize
void authorize(org.ldaptive.LdapEntry entry, String authorizationExpression) throws org.ldaptive.LdapException, EdAuthAuthorizationExceptionThis will attempt to authorize a user's givenLdapEntryvia the provided authorizationExpression.- Parameters:
entry-LdapEntryreturned from authentication to authorize withauthorizationExpression- Expression to authorize with- Throws:
org.ldaptive.LdapException- if the authentication fails for any reasonEdAuthAuthorizationException- if the authorization fails for any reason
-
getAffiliations
String[] getAffiliations(org.ldaptive.LdapEntry authResult)
This returns all the affiliations for the supplied entry.- Parameters:
authResult-LdapEntryto parse- Returns:
- user's affiliations
-
getGroupMembership
String[] getGroupMembership(org.ldaptive.LdapEntry authResult)
This returns all the group memberships for the supplied entry.- Parameters:
authResult-LdapEntryto parse- Returns:
- user's group memberships
-
getVirginiaTechPerson
VirginiaTechPerson getVirginiaTechPerson(org.ldaptive.LdapEntry authResult)
This will attempt to mapLdapEntryto aVirginiaTechPersonbean.- Parameters:
authResult-LdapEntryreturned from authentication to parse- Returns:
VirginiaTechPersonPOJO representation of theLdapEntry.
-
-