Identifier
, Comparable<Identifier>
, net.minidev.json.JSONAware
public final class AuthzId extends BaseIdentifier
Note that for the purpose of keying and comparing authorisation identities, the DNs are normalised and the usernames are converted to lower case.
DN form:
"dn: uid=alice,ou=people,dc=wonderland,dc=net"
Username form:
"u: alice"
Modifier and Type | Class | Description |
---|---|---|
static class |
AuthzId.IdentityType |
The identity data types.
|
Modifier and Type | Field | Description |
---|---|---|
static AuthzId |
ANONYMOUS |
Anonymous user identity.
|
DEFAULT_BYTE_LENGTH, SECURE_RANDOM
Constructor | Description |
---|---|
AuthzId(Username username) |
Creates a new authorisation identity from the specified username.
|
AuthzId(com.unboundid.ldap.sdk.DN dn) |
Creates a new authorisation identity from the specified DN.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object object) |
Overrides
Object.equals() . |
com.unboundid.ldap.sdk.DN |
getDN() |
Gets the identity DN.
|
AuthzId.IdentityType |
getIdentityType() |
Gets the identity type.
|
Username |
getUsername() |
Gets the identity username.
|
static AuthzId |
parse(String value) |
Parses a string representation of a SASL authorisation identity.
|
compareTo, hashCode, toJSONString, toString
public AuthzId(com.unboundid.ldap.sdk.DN dn)
Note that for the purpose of keying and comparing authorisation IDs, the DN will be normalised (simple normalisation, without consulting the schema).
dn
- The DN, must not be null
. If DN.NULL_DN
indicates an anonymous user.public AuthzId(Username username)
Note that for the purpose of keying and comparing authorisation IDs, the username will be converted to lower case.
username
- The username, must not be null
. If empty
indicates an anonymous user.public static AuthzId parse(String value) throws ParseException
value
- The string to parse, if null
or empty
ANONYMOUS
is returned.ParseException
- On a bad authzid syntax.public AuthzId.IdentityType getIdentityType()
public com.unboundid.ldap.sdk.DN getDN()
null
if specified as a username instead.public Username getUsername()
null
if specified as a DN instead.public boolean equals(Object object)
BaseIdentifier
Object.equals()
.equals
in class BaseIdentifier
object
- The object to compare to.true
if the objects have the same value, otherwise
false
.Copyright © 2018 Connect2id. All rights reserved.