Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.keycloak.authentication.model;
 
 import java.util.List;
 import java.util.Map;
 
AbstractModelAuthenticationProvider, which delegates authentication operations to different (external) realm

Author(s):
Marek Posolda
    public ExternalModelAuthenticationProvider(ProviderSession providerSession) {
    }
    @Override
    public String getName() {
    }
    @Override
    public List<StringgetAvailableOptions() {
        return Arrays.asList(.);
    }
    @Override
    public RealmModel getRealm(RealmModel currentRealmMap<StringStringconfigurationthrows AuthenticationProviderException {
        String realmId = configuration.get(.);
        if (realmId == null) {
            throw new AuthenticationProviderException("Option '" + . + "' not specified in configuration");
        }
        // TODO: This won't be needed when KeycloakSession is available from ProviderSession
        KeycloakSession session = ResteasyProviderFactory.getContextData(KeycloakSession.class);
        if (session == null) {
            throw new AuthenticationProviderException("KeycloakSession not available");
        }
        RealmModel realm = session.getRealm(realmId);
        if (realm == null) {
            throw new AuthenticationProviderException("Realm with id '" + realmId + "' doesn't exists");
        }
        return realm;
    }
New to GrepCode? Check out our FAQ X