public class BasicWebConsoleSecurityProvider extends Object implements WebConsoleSecurityProvider2
USER_ATTRIBUTE| Constructor and Description |
|---|
BasicWebConsoleSecurityProvider(org.osgi.framework.BundleContext bundleContext,
String username,
String password,
String realm) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Authenticates the given request or asks the client for credentials.
|
Object |
authenticate(String username,
String password)
Authenticates the user with the given user name and password.
|
boolean |
authorize(Object user,
String role)
All users authenticated with the repository are granted access for all roles in the Web Console.
|
public Object authenticate(String username, String password)
WebConsoleSecurityProviderauthenticate in interface WebConsoleSecurityProviderusername - The name of the user presented by the clientpassword - The password presented by the clientnull must be returned from this method.public boolean authorize(Object user, String role)
authorize in interface WebConsoleSecurityProvideruser - The object referring to the authenticated user. This is the
object returned from the WebConsoleSecurityProvider.authenticate(String, String)
method and will never be null.role - The requested roletrue if the user is given permission for the given
role.public boolean authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
WebConsoleSecurityProvider2
Implementations of this method are expected to respect and implement
the semantics of the HttpContext.handleSecurity method
as specified in the OSGi HTTP Service specification.
If this method returns true it is assumed the request
provided valid credentials identifying the user as accepted to access
the web console. In addition, the WebConsoleSecurityProvider2.USER_ATTRIBUTE request
attribute must be set to a non-null object reference
identifying the authenticated user.
If this method returns false the request to the web console
is terminated without any more response sent back to the client. That is
the implementation is expected to have informed the client in case of
non-granted access.
authenticate in interface WebConsoleSecurityProvider2request - The request objectresponse - The response objecttrue If the request provided valid credentials.Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.