Search in sources :

Example 1 with AuthenticationProviderDisplayInfo

use of edu.harvard.iq.dataverse.authorization.AuthenticationProviderDisplayInfo in project dataverse by IQSS.

the class LoginPage method listCredentialsAuthenticationProviders.

public List<AuthenticationProviderDisplayInfo> listCredentialsAuthenticationProviders() {
    List<AuthenticationProviderDisplayInfo> infos = new LinkedList<>();
    for (String id : authSvc.getAuthenticationProviderIdsOfType(CredentialsAuthenticationProvider.class)) {
        AuthenticationProvider authenticationProvider = authSvc.getAuthenticationProvider(id);
        infos.add(authenticationProvider.getInfo());
    }
    return infos;
}
Also used : CredentialsAuthenticationProvider(edu.harvard.iq.dataverse.authorization.CredentialsAuthenticationProvider) AuthenticationProvider(edu.harvard.iq.dataverse.authorization.AuthenticationProvider) ShibAuthenticationProvider(edu.harvard.iq.dataverse.authorization.providers.shib.ShibAuthenticationProvider) LinkedList(java.util.LinkedList) AuthenticationProviderDisplayInfo(edu.harvard.iq.dataverse.authorization.AuthenticationProviderDisplayInfo)

Example 2 with AuthenticationProviderDisplayInfo

use of edu.harvard.iq.dataverse.authorization.AuthenticationProviderDisplayInfo in project dataverse by IQSS.

the class EchoAuthenticationProviderFactory method buildProvider.

@Override
public AuthenticationProvider buildProvider(AuthenticationProviderRow aRow) throws AuthorizationSetupException {
    String rawData = aRow.getFactoryData();
    String[] data = { "", "" };
    if (rawData != null) {
        data = aRow.getFactoryData().split(",", -1);
    }
    try {
        return new EchoAuthenticationProvider(aRow.getId(), data[0], data[1], new AuthenticationProviderDisplayInfo(aRow.getId(), aRow.getTitle(), aRow.getSubtitle()));
    } catch (ArrayIndexOutOfBoundsException e) {
        throw new AuthorizationSetupException("Can't create Echo prov. Raw data: '" + rawData + "'", e);
    }
}
Also used : AuthorizationSetupException(edu.harvard.iq.dataverse.authorization.exceptions.AuthorizationSetupException) AuthenticationProviderDisplayInfo(edu.harvard.iq.dataverse.authorization.AuthenticationProviderDisplayInfo)

Aggregations

AuthenticationProviderDisplayInfo (edu.harvard.iq.dataverse.authorization.AuthenticationProviderDisplayInfo)2 AuthenticationProvider (edu.harvard.iq.dataverse.authorization.AuthenticationProvider)1 CredentialsAuthenticationProvider (edu.harvard.iq.dataverse.authorization.CredentialsAuthenticationProvider)1 AuthorizationSetupException (edu.harvard.iq.dataverse.authorization.exceptions.AuthorizationSetupException)1 ShibAuthenticationProvider (edu.harvard.iq.dataverse.authorization.providers.shib.ShibAuthenticationProvider)1 LinkedList (java.util.LinkedList)1