Package waffle.servlet
Class WindowsPrincipal
java.lang.Object
waffle.servlet.WindowsPrincipal
- All Implemented Interfaces:
Serializable
,Principal
- Direct Known Subclasses:
AutoDisposableWindowsPrincipal
A Windows Principal.
- See Also:
-
Constructor Summary
ConstructorDescriptionWindowsPrincipal
(IWindowsIdentity windowsIdentity) A windows principal.WindowsPrincipal
(IWindowsIdentity windowsIdentity, PrincipalFormat principalFormat, PrincipalFormat roleFormat) A windows principal. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Windows groups that the user is a member of.Underlying identity.getName()
Fully qualified name.Get an array of roles as a string.byte[]
getSid()
Byte representation of the SID.String representation of the SID.int
hashCode()
boolean
Checks whether the principal has a given role.toString()
-
Constructor Details
-
WindowsPrincipal
A windows principal.- Parameters:
windowsIdentity
- Windows identity.
-
WindowsPrincipal
public WindowsPrincipal(IWindowsIdentity windowsIdentity, PrincipalFormat principalFormat, PrincipalFormat roleFormat) A windows principal.- Parameters:
windowsIdentity
- Windows identity.principalFormat
- Principal format.roleFormat
- Role format.
-
-
Method Details
-
getSid
public byte[] getSid()Byte representation of the SID.- Returns:
- Array of bytes.
-
getSidString
String representation of the SID.- Returns:
- String.
-
getGroups
Windows groups that the user is a member of.- Returns:
- A map of group names to groups.
-
getRolesString
Get an array of roles as a string.- Returns:
- Role1, Role2, ...
-
hasRole
Checks whether the principal has a given role.- Parameters:
role
- Role name.- Returns:
- True if the principal has a role, false otherwise.
-
getName
Fully qualified name. -
getIdentity
Underlying identity.- Returns:
- String.
-
toString
-
equals
-
hashCode
public int hashCode()
-