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