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.LdapEntry
authenticate(String user, org.ldaptive.Credential credential, String... attributes)
This will attempt to authenticate a user against ED-Auth.void
authorize(org.ldaptive.LdapEntry entry, String authorizationExpression)
This will attempt to authorize a user's givenLdapEntry
via 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.VirginiaTechPerson
getVirginiaTechPerson(org.ldaptive.LdapEntry authResult)
This will attempt to mapLdapEntry
to aVirginiaTechPerson
bean.-
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, EdAuthAuthorizationException
This will attempt to authorize a user's givenLdapEntry
via the provided authorizationExpression.- Parameters:
entry
-LdapEntry
returned 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
-LdapEntry
to parse- Returns:
- user's affiliations
-
getGroupMembership
String[] getGroupMembership(org.ldaptive.LdapEntry authResult)
This returns all the group memberships for the supplied entry.- Parameters:
authResult
-LdapEntry
to parse- Returns:
- user's group memberships
-
getVirginiaTechPerson
VirginiaTechPerson getVirginiaTechPerson(org.ldaptive.LdapEntry authResult)
This will attempt to mapLdapEntry
to aVirginiaTechPerson
bean.- Parameters:
authResult
-LdapEntry
returned from authentication to parse- Returns:
VirginiaTechPerson
POJO representation of theLdapEntry
.
-
-