Search in sources :

Example 1 with BasicPasswordAuthenticationService

use of com.sun.enterprise.connectors.authentication.BasicPasswordAuthenticationService in project Payara by payara.

the class ConnectorSecurityAdminServiceImpl method getAuthenticationService.

/**
 * Obtain the authentication service associated with rar module.
 * Currently only the BasicPassword authentication is supported.
 *
 * @param rarName  Rar module Name
 * @param poolInfo Name of the pool. Used for creation of
 *                 BasicPasswordAuthenticationService
 * @return AuthenticationService
 */
public AuthenticationService getAuthenticationService(String rarName, PoolInfo poolInfo) {
    ConnectorDescriptor cd = _registry.getDescriptor(rarName);
    OutboundResourceAdapter obra = cd.getOutboundResourceAdapter();
    Set authMechs = obra.getAuthMechanisms();
    for (Object authMech : authMechs) {
        AuthMechanism authMechanism = (AuthMechanism) authMech;
        String mech = authMechanism.getAuthMechType();
        if (mech.equals("BasicPassword")) {
            return new BasicPasswordAuthenticationService(rarName, poolInfo);
        }
    }
    return null;
}
Also used : ConnectorDescriptor(com.sun.enterprise.deployment.ConnectorDescriptor) AuthMechanism(com.sun.enterprise.deployment.AuthMechanism) BasicPasswordAuthenticationService(com.sun.enterprise.connectors.authentication.BasicPasswordAuthenticationService) Set(java.util.Set) OutboundResourceAdapter(com.sun.enterprise.deployment.OutboundResourceAdapter)

Aggregations

BasicPasswordAuthenticationService (com.sun.enterprise.connectors.authentication.BasicPasswordAuthenticationService)1 AuthMechanism (com.sun.enterprise.deployment.AuthMechanism)1 ConnectorDescriptor (com.sun.enterprise.deployment.ConnectorDescriptor)1 OutboundResourceAdapter (com.sun.enterprise.deployment.OutboundResourceAdapter)1 Set (java.util.Set)1