01: /******************************************************
02: * File: AuthenticationMethod.java
03: *
04: *@author M. Ranganathan
05: *
06: */package examples.authorization;
07:
08: import javax.sip.*;
09: import javax.sip.message.*;
10: import javax.sip.header.*;
11: import javax.sip.address.*;
12:
13: public interface AuthenticationMethod {
14:
15: /**
16: * Get the authentication scheme
17: */
18: public String getScheme();
19:
20: /**
21: * Initialize the authentication method. This has to be done outside the
22: * constructor as the constructor is generic (created from the class name
23: * specified in the authentication method).
24: */
25: public void initialize();
26:
27: /**
28: * Get the authentication realm.
29: */
30: public String getRealm(String resource);
31:
32: /**
33: * get the authentication domain.
34: */
35: public String getDomain();
36:
37: /**
38: * Get the authentication Algorithm
39: */
40: public String getAlgorithm();
41:
42: /**
43: * Generate the challenge string.
44: */
45: public String generateNonce();
46:
47: /**
48: * Check the response and answer true if authentication succeeds. Not all of
49: * these fields are relevant for every method - a basic scheme may simply do
50: * a username password check.
51: *
52: * @param username
53: * is the username and password.
54: * @param authorizationHeader
55: * is the authorization header from the SIP request.
56: * @param requestLine
57: * is the RequestLine from the SIP Request.
58: */
59: public boolean doAuthenticate(String username,
60: AuthorizationHeader authorizationHeader, Request request);
61:
62: }
|