
hudson.security.TokenBasedRememberMeServices2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hudson-core Show documentation
Show all versions of hudson-core Show documentation
Contains the core Hudson code and view files to render HTML.
The newest version!
/*******************************************************************************
*
* Copyright (c) 2004-2009 Oracle Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*
* Kohsuke Kawaguchi
*
*
*******************************************************************************/
package hudson.security;
import org.springframework.security.ui.rememberme.TokenBasedRememberMeServices;
import org.springframework.security.Authentication;
import org.apache.commons.codec.digest.DigestUtils;
/**
* {@link TokenBasedRememberMeServices} with modification so as not to rely
* on the user password being available.
*
*
* This allows remember-me to work with security realms where the password
* is never available in clear text.
*
* @author Kohsuke Kawaguchi
*/
public class TokenBasedRememberMeServices2 extends TokenBasedRememberMeServices {
@Override
protected String makeTokenSignature(long tokenExpiryTime, String username, String password) {
String expectedTokenSignature = DigestUtils.md5Hex(username + ":" + tokenExpiryTime + ":"
+ "N/A" + ":" + getKey());
return expectedTokenSignature;
}
@Override
protected String retrievePassword(Authentication successfulAuthentication) {
return "N/A";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy