Package org.minijax.security
Class AuthUtils
java.lang.Object
org.minijax.security.AuthUtils
public class AuthUtils
extends java.lang.Object
The AuthUtils class provides helper methods for parsing the
HTTP Authorization header.
-
Method Summary
Modifier and Type Method Description static java.lang.Stringcreate(java.lang.String username, java.lang.String password)static java.lang.StringgetPassword(java.lang.String auth)Returns the password portion of a Basic Authentication header.static java.lang.StringgetUsername(java.lang.String auth)Returns the username portion of a Basic Authentication header.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
create
public static java.lang.String create(java.lang.String username, java.lang.String password) -
getUsername
public static java.lang.String getUsername(java.lang.String auth)Returns the username portion of a Basic Authentication header. Returns null if malformed.- Parameters:
auth- The Basic Authentication header.- Returns:
- The username portion or null if not available.
-
getPassword
public static java.lang.String getPassword(java.lang.String auth)Returns the password portion of a Basic Authentication header. Returns null if malformed.- Parameters:
auth- The Basic Authentication header.- Returns:
- The password portion or null if not available.
-