Search in sources :

Example 1 with AbstractChannelFactory

use of com.evolveum.midpoint.authentication.impl.factory.channel.AbstractChannelFactory in project midpoint by Evolveum.

the class AuthSequenceUtil method buildAuthChannel.

public static AuthenticationChannel buildAuthChannel(AuthChannelRegistryImpl registry, AuthenticationSequenceType sequence) {
    Validate.notNull(sequence, "Couldn't build authentication channel object, because sequence is null");
    String channelId = null;
    AuthenticationSequenceChannelType channelSequence = sequence.getChannel();
    if (channelSequence != null) {
        channelId = channelSequence.getChannelId();
    }
    AbstractChannelFactory factory = registry.findModelFactory(channelId);
    if (factory == null) {
        LOGGER.error("Couldn't find factory for {}", channelId);
        return null;
    }
    AuthenticationChannel channel = null;
    try {
        channel = factory.createAuthChannel(channelSequence);
    } catch (Exception e) {
        LOGGER.error("Couldn't create channel for {}", channelId);
    }
    return channel;
}
Also used : AuthenticationChannel(com.evolveum.midpoint.authentication.api.AuthenticationChannel) AbstractChannelFactory(com.evolveum.midpoint.authentication.impl.factory.channel.AbstractChannelFactory) ServletException(javax.servlet.ServletException) AuthenticationException(org.springframework.security.core.AuthenticationException) AuthenticationServiceException(org.springframework.security.authentication.AuthenticationServiceException) IOException(java.io.IOException)

Aggregations

AuthenticationChannel (com.evolveum.midpoint.authentication.api.AuthenticationChannel)1 AbstractChannelFactory (com.evolveum.midpoint.authentication.impl.factory.channel.AbstractChannelFactory)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 AuthenticationServiceException (org.springframework.security.authentication.AuthenticationServiceException)1 AuthenticationException (org.springframework.security.core.AuthenticationException)1