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 public class SimpleAuthConfig implements ServerAuthConfig
30 {
31 public static final String HTTP_SERVLET = "HttpServlet";
32
33 private final String _appContext;
34
35 private final ServerAuthContext _serverAuthContext;
36
37 public SimpleAuthConfig(String appContext, ServerAuthContext serverAuthContext)
38 {
39 this._appContext = appContext;
40 this._serverAuthContext = serverAuthContext;
41 }
42
43 public ServerAuthContext getAuthContext(String authContextID, Subject serviceSubject, Map properties) throws AuthException
44 {
45 return _serverAuthContext;
46 }
47
48
49 public String getAppContext()
50 {
51 return _appContext;
52 }
53
54
55 public String getAuthContextID(MessageInfo messageInfo) throws IllegalArgumentException
56 {
57 return null;
58 }
59
60 public String getMessageLayer()
61 {
62 return HTTP_SERVLET;
63 }
64
65 public boolean isProtected()
66 {
67 return true;
68 }
69
70 public void refresh()
71 {
72 }
73 }