Class BasicAuthentication
java.lang.Object
net.sourceforge.jbizmo.commons.authentication.BasicAuthentication
Utility class for HTTP basic access authentication
Copyright 2018 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateAuthentication(String userName, String password) Create a basic authentication string by using the provided credentialsstatic StringgetPassword(String authenticationString) Extract the password from the given authentication stringstatic StringgetUserName(String authenticationString) Extract the user name from the given authentication string
-
Field Details
-
HTTP_HEADER_AUTHORIZATION
- See Also:
-
-
Method Details
-
createAuthentication
Create a basic authentication string by using the provided credentials- Parameters:
userName-password-- Returns:
- the authentication string
-
getUserName
Extract the user name from the given authentication string- Parameters:
authenticationString-- Returns:
- the user name
- Throws:
IllegalArgumentException- if the authentication string is either empty or if it has an illegal format
-
getPassword
Extract the password from the given authentication string- Parameters:
authenticationString-- Returns:
- the password
- Throws:
IllegalArgumentException- if the authentication string is either empty or if it has an illegal format
-