Authentication - AuthenticationHandlerPage added by Felix MeschbergerAuthenticationHandlerThe AuthenticationHandler interface defines the service API which may be implemented by authentication handlers registered as OSGi services. The AuthenticationHandler services have a single required service registration property which is used to identify requests to which the AuthenticationHandler service is applicable:
Each path may be an absolute URL, an URL with just the host/port and path or just a plain absolute path:
When looking for an AuthenticationHandler the authentication handler is selected whose path is the longest match on the request URL. If the service is registered with Scheme and Host/Port, these must exactly match for the service to be eligible. The value of path service registration property value triggering the call to any of the AuthenticationHandler methods is available as the path request attribute (for the time of the method call only). If the service is registered with multiple path values, the value of the path request attribute may be used to implement specific handling. Sample implementationsHTTP Basic Authentication Handler
Interestingly the dropCredentials method is implemented in the same way as the requestCredentials method. The reason for this is, that HTTP Basic authentication does not have a notion of login and logout. Rather the request is accompanied with an Authorization header or not. The contents of this header is usually cached by the client browser. So logout is actually simulated by sending a 401/UNAUTHORIZED status thus causing the client browser to clear the cache and ask for user name and password. H4. Form Based Authentication Handler
Change Notification Preferences
View Online
|
Add Comment
|
- [CONF] Apache Sling Website > Authentication - Authenticatio... confluence
