public class NettySecurityContext extends Object implements SecurityContext
| Modifier and Type | Field and Description |
|---|---|
protected String |
authScheme |
protected SecurityDomain |
domain |
protected boolean |
isSecure |
protected Principal |
principal |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH| Constructor and Description |
|---|
NettySecurityContext() |
NettySecurityContext(Principal principal,
SecurityDomain domain,
String authScheme,
boolean secure) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthenticationScheme()
Returns the string value of the authentication scheme used to protect
the resource.
|
Principal |
getUserPrincipal()
Returns a
java.security.Principal object containing the
name of the current authenticated user. |
boolean |
isSecure()
Returns a boolean indicating whether this request was made
using a secure channel, such as HTTPS.
|
boolean |
isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included
in the specified logical "role".
|
protected final Principal principal
protected final SecurityDomain domain
protected final String authScheme
protected final boolean isSecure
public NettySecurityContext(Principal principal, SecurityDomain domain, String authScheme, boolean secure)
public NettySecurityContext()
public Principal getUserPrincipal()
SecurityContextjava.security.Principal object containing the
name of the current authenticated user. If the user
has not been authenticated, the method returns null.getUserPrincipal in interface SecurityContextjava.security.Principal containing the name
of the user making this request; null if the user has not been
authenticatedpublic boolean isUserInRole(String role)
SecurityContextfalse.isUserInRole in interface SecurityContextrole - a String specifying the name of the roleboolean indicating whether the user making
the request belongs to a given role; false if the user
has not been authenticatedpublic boolean isSecure()
SecurityContextisSecure in interface SecurityContexttrue if the request was made using a secure
channel, false otherwisepublic String getAuthenticationScheme()
SecurityContextgetAuthenticationScheme in interface SecurityContextCopyright © 2013. All Rights Reserved.