blob: 733aab013a80bf22925e90d9e0e1acd560ed30f8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
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<Satellite> satellites;
public AuthenticationData(String satToken, String masterToken, List<Satellite> 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;
}
|