git-svn-id: https://serverad.studio-ml.local/svn/repo/projects/IntegryManagmentSystem/trunk@1679 7169d44f-50de-5945-979c-d5cbc11e8a2d
This commit is contained in:
@@ -20,6 +20,7 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jboss.resteasy.util.Base64;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
|
||||
import org.springframework.security.core.Authentication;
|
||||
@@ -66,6 +67,17 @@ public class RestSecurityFilter extends GenericFilterBean {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
if(credentials.startsWith("Basic ")){
|
||||
final String encodedUserPassword = credentials.replaceFirst("Basic ", "");
|
||||
// Decode username and password
|
||||
try {
|
||||
credentials = new String(Base64.decode(encodedUserPassword));
|
||||
} catch (IOException e) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Authorization header is in the form <public_access_key>:<signature>
|
||||
String auth[] = credentials.split(":");
|
||||
|
||||
Reference in New Issue
Block a user