JavaBeans compatible no-arg constructor.
Constructs a new UsernamePasswordToken encapsulating the username and password submitted during an authentication attempt, with a <tt>null</tt> {@link #getHost() host} and a <tt>rememberMe</tt> default of <tt>false</tt>.
Constructs a new UsernamePasswordToken encapsulating the username and password submitted during an authentication attempt, with a <tt>null</tt> {@link #getHost() host} and a <tt>rememberMe</tt> default of <tt>false</tt> <p/> <p>This is a convenience constructor and maintains the password internally via a character array, i.e. <tt>password.toCharArray();</tt>. Note that storing a password as a string in your code could have possible security implications as noted in the class JavaDoc.</p>
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, the inetAddress from where the attempt is occurring, and a default <tt>rememberMe</tt> value of <tt>false</tt>
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, the inetAddress from where the attempt is occurring, and a default <tt>rememberMe</tt> value of <tt>false</tt> <p/> <p>This is a convenience constructor and maintains the password internally via a character array, i.e. <tt>password.toCharArray();</tt>. Note that storing a password as a string in your code could have possible security implications as noted in the class JavaDoc.</p>
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, as well as if the user wishes their identity to be remembered across sessions.
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, as well as if the user wishes their identity to be remembered across sessions. <p/> <p>This is a convenience constructor and maintains the password internally via a character array, i.e. <tt>password.toCharArray();</tt>. Note that storing a password as a string in your code could have possible security implications as noted in the class JavaDoc.</p>
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, if the user wishes their identity to be remembered across sessions, and the inetAddress from where the attempt is occurring.
Constructs a new UsernamePasswordToken encapsulating the username and password submitted, if the user wishes their identity to be remembered across sessions, and the inetAddress from where the attempt is occurring. <p/> <p>This is a convenience constructor and maintains the password internally via a character array, i.e. <tt>password.toCharArray();</tt>. Note that storing a password as a string in your code could have possible security implications as noted in the class JavaDoc.</p>
Clears out (nulls) the username, password, rememberMe, and inetAddress. The password bytes are explicitly set to <tt>0x00</tt> before nulling to eliminate the possibility of memory access at a later time.
Returns the {@link #getPassword() password} char array.
Returns the host name or IP string from where the authentication attempt occurs. May be <tt>null</tt> if the host name/IP is unknown or explicitly omitted. It is up to the Authenticator implementation processing this token if an authentication attempt without a host is valid or not. <p/> <p>(Shiro's default Authenticator allows <tt>null</tt> hosts to support localhost and proxy server environments).</p>
Returns the password submitted during an authentication attempt as a character array.
Simply returns {@link #getUsername() getUsername()}.
Returns the username submitted during an authentication attempt.
Returns <tt>true</tt> if the submitting user wishes their identity (principal(s)) to be remembered across sessions, <tt>false</tt> otherwise. Unless overridden, this value is <tt>false</tt> by default.
Sets the host name or IP string from where the authentication attempt occurs. It is up to the Authenticator implementation processing this token if an authentication attempt without a host is valid or not. <p/> <p>(Shiro's default Authenticator allows <tt>null</tt> hosts to allow localhost and proxy server environments).</p>
Sets the password for submission during an authentication attempt.
Sets if the submitting user wishes their identity (principal(s)) to be remembered across sessions. Unless overridden, the default value is <tt>false</tt>, indicating <em>not</em> to be remembered across sessions.
Sets the username for submission during an authentication attempt.
Returns the string representation. It does not include the password in the resulting string for security reasons to prevent accidentally printing out a password that might be widely viewable).
Returns the host name of the client from where the authentication attempt originates or if the Shiro environment cannot or chooses not to resolve the hostname to improve performance, this method returns the string representation of the client's IP address. <p/> When used in web environments, this value is usually the same as the {@code ServletRequest.getRemoteHost()} value.
Returns {@code true} if the submitting user wishes their identity (principal(s)) to be remembered across sessions, {@code false} otherwise.
<p>A simple username/password authentication token to support the most widely-used authentication mechanism. This class also : the {@link RememberMeAuthenticationToken RememberMeAuthenticationToken} interface to support "Remember Me" services across user sessions as well as the {@link hunt.shiro.authc.HostAuthenticationToken HostAuthenticationToken} interface to retain the host name or IP address location from where the authentication attempt is occurring.</p> <p/> <p>"Remember Me" authentications are disabled by default, but if the application developer wishes to allow it for a login attempt, all that is necessary is to call {@link #setRememberMe setRememberMe(true)}. If the underlying <tt>SecurityManager</tt> implementation also supports <tt>RememberMe</tt> services, the user's identity will be remembered across sessions. <p/> <p>Note that this class stores a password as[] a char instead of a string (which may seem more logical). This is because Strings are immutable and their internal value cannot be overwritten - meaning even a nulled string instance might be accessible in memory at a later time (e.g. memory dump). This is not good for sensitive information such as passwords. For more information, see the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/security/jce/JCERefGuide.html#PBEEx"> Java Cryptography Extension Reference Guide</a>.</p> <p/> <p>To avoid this possibility of later memory access, the application developer should always call {@link #clear() clear()} after using the token to perform a login attempt.</p>