1 | <?php |
||
36 | class AuthenticationManagerWrapper implements AuthenticationManagerInterface |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The authentication manager instance to be wrapped. |
||
41 | * |
||
42 | * @var \AppserverIo\Psr\Auth\AuthenticationManagerInterface |
||
43 | */ |
||
44 | protected $authenticationManager; |
||
45 | |||
46 | /** |
||
47 | * Injects the passed authentication manager instance into this wrapper. |
||
48 | * |
||
49 | * @param \AppserverIo\Psr\Auth\AuthenticationManagerInterface $authenticationManager The authentication manager instance used for initialization |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function injectAuthenticationManager(AuthenticationManagerInterface $authenticationManager) |
||
57 | |||
58 | /** |
||
59 | * Return's the authentication manager instance. |
||
60 | * |
||
61 | * @return \AppserverIo\Psr\Auth\AuthenticationManagerInterface The authentication manager instance |
||
62 | */ |
||
63 | public function getAuthenticationManager() |
||
67 | |||
68 | /** |
||
69 | * Handles request in order to authenticate. |
||
70 | * |
||
71 | * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The request instance |
||
72 | * @param \AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse The response instance |
||
73 | * |
||
74 | * @return boolean TRUE if the authentication has been successful, else FALSE |
||
75 | */ |
||
76 | public function handleRequest(HttpServletRequestInterface $servletRequest, HttpServletResponseInterface $servletResponse) |
||
80 | |||
81 | /** |
||
82 | * Add's the passed realm the the authentication manager. |
||
83 | * |
||
84 | * @param \AppserverIo\Appserver\ServletEngine\Security\RealmInterface $realm The realm to add |
||
85 | * |
||
86 | * @return void |
||
87 | */ |
||
88 | public function addRealm(RealmInterface $realm) |
||
92 | |||
93 | /** |
||
94 | * Returns the map with the security domains. |
||
95 | * |
||
96 | * @return \AppserverIo\Collections\MapInterface The security domains |
||
97 | */ |
||
98 | public function getRealms() |
||
102 | |||
103 | /** |
||
104 | * Register's the passed authenticator. |
||
105 | * |
||
106 | * @param \AppserverIo\Appserver\ServletEngine\Authenticator\AuthenticatorInterface $authenticator The authenticator to add |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | public function addAuthenticator(AuthenticatorInterface $authenticator) |
||
114 | |||
115 | /** |
||
116 | * Returns the configured authenticator for the passed URL pattern authenticator mapping. |
||
117 | * |
||
118 | * @param \AppserverIo\Appserver\ServletEngine\Security\MappingInterface|null $mapping The URL pattern to authenticator mapping |
||
119 | * |
||
120 | * @return \AppserverIo\Storage\StorageInterface The storage with the authentication types |
||
121 | * @throws \AppserverIo\Http\Authentication\AuthenticationException Is thrown if the authenticator with the passed key is not available |
||
122 | */ |
||
123 | public function getAuthenticator(MappingInterface $mapping = null) |
||
127 | |||
128 | /** |
||
129 | * Returns the configured authentication types. |
||
130 | * |
||
131 | * @return \AppserverIo\Storage\StorageInterface The storage with the authentication types |
||
132 | */ |
||
133 | public function getAuthenticators() |
||
137 | |||
138 | /** |
||
139 | * Register's a new URL pattern to authentication type mapping. |
||
140 | * |
||
141 | * @param \AppserverIo\Appserver\ServletEngine\Security\MappingInterface $mapping The URL pattern to authenticator mapping |
||
142 | * |
||
143 | * @return void |
||
144 | */ |
||
145 | public function addMapping(MappingInterface $mapping) |
||
149 | |||
150 | /** |
||
151 | * Return's the storage for the URL pattern to authenticator mappings. |
||
152 | * |
||
153 | * @return \AppserverIo\Storage\StorageInterface The storage instance |
||
154 | */ |
||
155 | public function getMappings() |
||
159 | |||
160 | /** |
||
161 | * Returns the realm with the passed name. |
||
162 | * |
||
163 | * @param string $realmName The name of the requested realm |
||
164 | * |
||
165 | * @return object The requested realm instance |
||
166 | */ |
||
167 | public function getRealm($realmName) |
||
171 | |||
172 | /** |
||
173 | * The managers unique identifier. |
||
174 | * |
||
175 | * @return string The unique identifier |
||
176 | */ |
||
177 | public function getIdentifier() |
||
181 | |||
182 | /** |
||
183 | * Has been automatically invoked by the container after the application |
||
184 | * instance has been created. |
||
185 | * |
||
186 | * @param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function initialize(ApplicationInterface $application) |
||
194 | |||
195 | /** |
||
196 | * Returns the value with the passed name from the context. |
||
197 | * |
||
198 | * @param string $key The key of the value to return from the context. |
||
199 | * |
||
200 | * @return mixed The requested attribute |
||
201 | */ |
||
202 | public function getAttribute($key) |
||
206 | |||
207 | /** |
||
208 | * Stops the manager instance. |
||
209 | * |
||
210 | * @return void |
||
211 | */ |
||
212 | public function stop() |
||
216 | |||
217 | /** |
||
218 | * Lifecycle callback that'll be invoked after the application has been started. |
||
219 | * |
||
220 | * @param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance |
||
221 | * |
||
222 | * @return void |
||
223 | */ |
||
224 | public function postStartup(ApplicationInterface $application) |
||
228 | } |
||
229 |