Module one.jpro.platform.auth.core
Class UsernamePasswordCredentials
java.lang.Object
one.jpro.platform.auth.core.basic.UsernamePasswordCredentials
- All Implemented Interfaces:
Credentials
Username and password credentials holder.
-
Property Summary
Properties -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.UsernamePasswordCredentials(@NotNull String username, @NotNull String password) Constructor with username and password. -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable StringGets the value of thepasswordproperty.@Nullable StringGets the value of theusernameproperty.inthashCode()final @NotNull javafx.beans.property.StringPropertyfinal voidsetPassword(@NotNull String password) Sets the value of thepasswordproperty.voidsetUsername(@NotNull String username) Sets the value of theusernameproperty.Encodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.org.json.JSONObjecttoJSON()Convert the credential information to JSON format.final @NotNull javafx.beans.property.StringProperty<V> voidvalidate(V arg) Implementors should override this method to perform validation.
-
Property Details
-
username
@NotNull public final @NotNull javafx.beans.property.StringProperty usernameProperty- See Also:
-
password
@NotNull public final @NotNull javafx.beans.property.StringProperty passwordProperty- See Also:
-
-
Constructor Details
-
UsernamePasswordCredentials
public UsernamePasswordCredentials()Default constructor. -
UsernamePasswordCredentials
public UsernamePasswordCredentials(@NotNull @NotNull String username, @NotNull @NotNull String password) Constructor with username and password.- Parameters:
username- the user's namepassword- the user's password
-
-
Method Details
-
getUsername
Gets the value of theusernameproperty.- Property description:
- Returns:
- the value of the
usernameproperty - See Also:
-
setUsername
Sets the value of theusernameproperty.- Property description:
- Parameters:
username- the value for theusernameproperty- See Also:
-
usernameProperty
@NotNull public final @NotNull javafx.beans.property.StringProperty usernameProperty()- Returns:
- the
usernameproperty - See Also:
-
getPassword
Gets the value of thepasswordproperty.- Property description:
- Returns:
- the value of the
passwordproperty - See Also:
-
setPassword
Sets the value of thepasswordproperty.- Property description:
- Parameters:
password- the value for thepasswordproperty- See Also:
-
passwordProperty
@NotNull public final @NotNull javafx.beans.property.StringProperty passwordProperty()- Returns:
- the
passwordproperty - See Also:
-
validate
Description copied from interface:CredentialsImplementors should override this method to perform validation. An argument is allowed to allow custom validation.- Specified by:
validatein interfaceCredentials- Type Parameters:
V- the generic type of the argument- Parameters:
arg- optional argument or null.- Throws:
CredentialValidationException- when the validation fails
-
equals
-
hashCode
public int hashCode() -
toHttpAuthorization
Description copied from interface:CredentialsEncodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.- Specified by:
toHttpAuthorizationin interfaceCredentials- Returns:
- HTTP header including scheme.
-
toJSON
public org.json.JSONObject toJSON()Description copied from interface:CredentialsConvert the credential information to JSON format.- Specified by:
toJSONin interfaceCredentials- Returns:
- a JSON object.
-