Module one.jpro.platform.auth.core
Interface Authentication
- All Superinterfaces:
Principal
- All Known Implementing Classes:
User
Represents the state of an authentication.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull AuthenticationBuild anAuthenticationinstance for the user.static @NotNull AuthenticationBuild anAuthenticationinstance for the user.static @NotNull AuthenticationBuild anAuthenticationinstance for the user.static @NotNull Authenticationcreate(@NotNull String username, @Nullable Set<String> roles, @Nullable Map<String, Object> attributes) Builds anAuthenticationinstance for the user.static @NotNull Authenticationcreate(@NotNull org.json.JSONObject json) Builds anAuthenticationinstance for the user from aJSONObject.Any additional attributes in the authentication.default @NotNull Collection<String> getRoles()Any roles associated with the authentication.default @NotNull org.json.JSONObjecttoJSON()Convert the authentication information to JSON format.
-
Field Details
-
KEY_NAME
- See Also:
-
KEY_ROLES
- See Also:
-
KEY_ATTRIBUTES
- See Also:
-
-
Method Details
-
getAttributes
Any additional attributes in the authentication.- Returns:
- a
Mapcontaining the attributes;
-
getRoles
Any roles associated with the authentication.- Returns:
- a
Collectionof roles as string
-
toJSON
@NotNull default @NotNull org.json.JSONObject toJSON()Convert the authentication information to JSON format.- Returns:
- a JSON object.
-
create
Build anAuthenticationinstance for the user.- Parameters:
username- the user's name- Returns:
- an
Authenticationobject
-
create
@NotNull static @NotNull Authentication create(@NotNull @NotNull String username, @NotNull @NotNull Set<String> roles) Build anAuthenticationinstance for the user.- Parameters:
username- the user's nameroles- the user's roles- Returns:
- an
Authenticationobject
-
create
@NotNull static @NotNull Authentication create(@NotNull @NotNull String username, @NotNull @NotNull Map<String, Object> attributes) Build anAuthenticationinstance for the user.- Parameters:
username- the user's nameattributes- the user's attributes- Returns:
- an
Authenticationobject
-
create
@NotNull static @NotNull Authentication create(@NotNull @NotNull String username, @Nullable @Nullable Set<String> roles, @Nullable @Nullable Map<String, Object> attributes) Builds anAuthenticationinstance for the user.- Parameters:
username- User's nameroles- User's rolesattributes- User's attributes- Returns:
- an
Authenticationobject
-
create
Builds anAuthenticationinstance for the user from aJSONObject.- Parameters:
json- aJSONObjectcontaining user's data.- Returns:
- an
Authenticationobject
-