Interface EdAuthService

  • All Superinterfaces:
    EdOperation
    All Known Implementing Classes:
    EdAuth, Login

    public interface EdAuthService
    extends EdOperation
    Add facilities for authentication and authorization to ED clients.
    Author:
    Middleware Services
    • 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 bind
        credential - credential for bind
        attributes - attributes to retrieve (ie EdContext.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 given LdapEntry via the provided authorizationExpression.
        Parameters:
        entry - LdapEntry returned from authentication to authorize with
        authorizationExpression - Expression to authorize with
        Throws:
        org.ldaptive.LdapException - if the authentication fails for any reason
        EdAuthAuthorizationException - 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 map LdapEntry to a VirginiaTechPerson bean.
        Parameters:
        authResult - LdapEntry returned from authentication to parse
        Returns:
        VirginiaTechPerson POJO representation of the LdapEntry.