@ApplicationScoped public class DigestLogin extends AbstractLogin
A1 = MD5(username + ':' + realm + ':' + password)
A2 = MD5(method + ':' + uri)
digest = MD5(A1 + ':' + nonce + A2)
_auth, _singleSignon
LOGIN_PASSWORD, LOGIN_USER, LOGIN_USER_NAME
Constructor and Description |
---|
DigestLogin() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
decodeDigest(java.lang.String digest) |
java.lang.String |
getAuthType()
Returns the authentication type.
|
protected long |
getRandomLong(ServletContext application) |
java.lang.String |
getRealmName()
Gets the realm.
|
protected java.security.Principal |
getUserPrincipalImpl(HttpServletRequest request)
Returns the principal from a digest authentication
|
protected void |
loginChallenge(HttpServletRequest req,
HttpServletResponse res)
Sends a challenge for basic authentication.
|
protected java.lang.String |
scanKey(CharCursor cursor) |
protected java.lang.String |
scanValue(CharCursor cursor) |
void |
setRealmName(java.lang.String realm)
Sets the login realm.
|
protected void |
skipWhitespace(CharCursor cursor) |
findSavedUser, getAuthenticator, getLoginPrincipalImpl, getSingleSignon, getUserPrincipal, init, isLoginUsedForRequest, isLogoutOnSessionTimeout, isPasswordBased, isSavedUserValid, isSessionSaveLogin, isUserInRole, login, login, loginSuccessResponse, logout, logoutImpl, saveUser, sessionInvalidate, setAuthenticator, setLogoutOnSessionTimeout, setSessionSaveLogin, toString
public void setRealmName(java.lang.String realm)
public java.lang.String getRealmName()
public java.lang.String getAuthType()
getAuthType
in interface Login
getAuthType
in class AbstractLogin
protected java.security.Principal getUserPrincipalImpl(HttpServletRequest request)
getUserPrincipalImpl
in class AbstractLogin
auth
- the authenticator for this application.protected void loginChallenge(HttpServletRequest req, HttpServletResponse res) throws ServletException, java.io.IOException
loginChallenge
in class AbstractLogin
ServletException
java.io.IOException
protected long getRandomLong(ServletContext application)
protected byte[] decodeDigest(java.lang.String digest)
protected java.lang.String scanKey(CharCursor cursor)
protected java.lang.String scanValue(CharCursor cursor)
protected void skipWhitespace(CharCursor cursor)