public class User extends Object
Please consult the documentation for a detailed explanation.
NOTE: This class has been automatically generated from theoriginal non RX-ified interface using Vert.x codegen.| Modifier and Type | Field and Description |
|---|---|
static TypeArg<User> |
__TYPE_ARG |
| Constructor and Description |
|---|
User(Object delegate) |
User(io.vertx.ext.auth.User delegate) |
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.json.JsonObject |
attributes()
Gets extra attributes of the user.
|
Authorizations |
authorizations()
Returns user's authorizations that have been previously loaded by the providers.
|
User |
clearCache()
Deprecated.
|
boolean |
containsKey(String key)
Checks if a value exists on the user object.
|
static User |
create(io.vertx.core.json.JsonObject principal)
Factory for user instances that are free form.
|
static User |
create(io.vertx.core.json.JsonObject principal,
io.vertx.core.json.JsonObject attributes)
Factory for user instances that are free form.
|
boolean |
equals(Object o) |
boolean |
expired()
Flags this user object to be expired.
|
boolean |
expired(int leeway)
Flags this user object to be expired.
|
static User |
fromName(String username)
Factory for user instances that are single string.
|
static User |
fromToken(String token)
Factory for user instances that are single string.
|
<T> T |
get(String key)
Get a value from the user object.
|
io.vertx.ext.auth.User |
getDelegate() |
int |
hashCode() |
io.reactivex.rxjava3.core.Single<Boolean> |
isAuthorized(Authorization authority)
Deprecated.
|
io.reactivex.rxjava3.core.Single<Boolean> |
isAuthorized(String authority)
Deprecated.
|
User |
merge(User other)
Merge the principal and attributes of a second user into this object properties.
|
static User |
newInstance(io.vertx.ext.auth.User arg) |
io.vertx.core.json.JsonObject |
principal()
Get the underlying principal for the User.
|
io.reactivex.rxjava3.core.Single<Boolean> |
rxIsAuthorized(Authorization authority)
Deprecated.
|
io.reactivex.rxjava3.core.Single<Boolean> |
rxIsAuthorized(String authority)
Deprecated.
|
void |
setAuthProvider(AuthProvider authProvider)
Deprecated.
|
String |
subject()
The user subject.
|
String |
toString() |
public User(io.vertx.ext.auth.User delegate)
public User(Object delegate)
public io.vertx.ext.auth.User getDelegate()
public static User fromName(String username)
"username" with the name as value.username - the value for this userpublic static User fromToken(String token)
"access_token" with the name as value.token - the value for this userpublic static User create(io.vertx.core.json.JsonObject principal)
principal - the free form json principalpublic static User create(io.vertx.core.json.JsonObject principal, io.vertx.core.json.JsonObject attributes)
principal - the free form json principalattributes - the free form json attributes that further describe the principalpublic String subject()
principal.username - Usually for username/password or webauthn authenticationprincipal.userHandle - Optional field for webauthnattributes.idToken.sub - For OpenID Connect ID Tokensattributes.[rootClaim?]accessToken.sub - For OpenID Connect/OAuth2 Access Tokensnull.public io.vertx.core.json.JsonObject attributes()
public boolean expired()
true if expiredpublic boolean expired(int leeway)
exp "expiration" timestamp in seconds.iat "issued at" in seconds.nbf "not before" in seconds.attributes() do not contain a key
then principal() properties are checked.
If all of the properties are not available the user will not expire.
Implementations of this interface might relax this rule to account for a leeway to safeguard against clock drifting.
leeway - a greater than zero leeway value.true if expiredpublic <T> T get(String key)
rootClaim the look up will happen in the attributes[rootClaim]attributes()principal()nullkey - the key to look uppublic boolean containsKey(String key)
rootClaim the look up will happen in the attributes[rootClaim]attributes()principal()nullkey - the key to look uppublic Authorizations authorizations()
@Deprecated public io.reactivex.rxjava3.core.Single<Boolean> isAuthorized(Authorization authority)
authority - the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.@Deprecated public io.reactivex.rxjava3.core.Single<Boolean> rxIsAuthorized(Authorization authority)
authority - the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.@Deprecated public io.reactivex.rxjava3.core.Single<Boolean> isAuthorized(String authority)
authority - the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.@Deprecated public io.reactivex.rxjava3.core.Single<Boolean> rxIsAuthorized(String authority)
authority - the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.@Deprecated public User clearCache()
public io.vertx.core.json.JsonObject principal()
{
"username", "tim"
}
@Deprecated public void setAuthProvider(AuthProvider authProvider)
authProvider - the AuthProvider - this must be the same type of AuthProvider that originally created the Userpublic User merge(User other)
userA = {
attributes: {
roles: [ 'read' ]
}
userB = {
attributes: {
roles: [ 'write' ]
}
}
}
When performing a merge of userA with userB, you will get:
userA.merge(userB);
// results in
{
attributes: {
roles: [ 'read', 'write' ]
}
}other - the other user to mergepublic static User newInstance(io.vertx.ext.auth.User arg)
Copyright © 2022 Eclipse. All rights reserved.