1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.eclipse.jetty.security.jaspi;
15
16 import java.util.Map;
17
18 import javax.security.auth.Subject;
19 import javax.security.auth.message.AuthException;
20 import javax.security.auth.message.MessageInfo;
21 import javax.security.auth.message.config.ServerAuthConfig;
22 import javax.security.auth.message.config.ServerAuthContext;
23
24
25
26
27 public class SimpleAuthConfig implements ServerAuthConfig
28 {
29 public static final String HTTP_SERVLET = "HttpServlet";
30
31 private final String _appContext;
32
33 private final ServerAuthContext _serverAuthContext;
34
35 public SimpleAuthConfig(String appContext, ServerAuthContext serverAuthContext)
36 {
37 this._appContext = appContext;
38 this._serverAuthContext = serverAuthContext;
39 }
40
41 public ServerAuthContext getAuthContext(String authContextID, Subject serviceSubject, Map properties) throws AuthException
42 {
43 return _serverAuthContext;
44 }
45
46
47 public String getAppContext()
48 {
49 return _appContext;
50 }
51
52
53 public String getAuthContextID(MessageInfo messageInfo) throws IllegalArgumentException
54 {
55 return null;
56 }
57
58 public String getMessageLayer()
59 {
60 return HTTP_SERVLET;
61 }
62
63 public boolean isProtected()
64 {
65 return true;
66 }
67
68 public void refresh()
69 {
70 }
71 }