package org.openslx.dozmod.authentication; import java.util.List; import org.openslx.bwlp.thrift.iface.Satellite; import org.openslx.dozmod.authentication.ShibbolethEcp.ReturnCode; /** * @author Jonathan Bauer * */ public interface Authenticator { /** * Callback interface to the login to be called after a login * Note that this will be called after every login, independent * of the success of the operation. This way the GUI can show a * corresponding message to the user. */ interface AuthenticatorCallback { void postLogin(ReturnCode returnCode, AuthenticationData data, Throwable t); } public class AuthenticationData { public final String satelliteToken; public final String masterToken; public final List satellites; public AuthenticationData(String satToken, String masterToken, List sats) { this.satelliteToken = satToken; this.masterToken = masterToken; this.satellites = sats; } } /** * Definition of the generic login method. * * @param username The username as String * @param password The password as String * @param callback The callback function to be called after the login * @throws Exception */ void login(String username, String password, AuthenticatorCallback callback) throws Exception; }