diff --git a/imooc-security-app/src/main/java/com/imooc/security/app/authentication/ImoocAuthenticationSuccessHandler.java b/imooc-security-app/src/main/java/com/imooc/security/app/authentication/ImoocAuthenticationSuccessHandler.java index 27814bf..6beb483 100644 --- a/imooc-security-app/src/main/java/com/imooc/security/app/authentication/ImoocAuthenticationSuccessHandler.java +++ b/imooc-security-app/src/main/java/com/imooc/security/app/authentication/ImoocAuthenticationSuccessHandler.java @@ -103,7 +103,7 @@ private String[] extractAndDecodeHeader(String header, HttpServletRequest reques byte[] base64Token = header.substring(6).getBytes("UTF-8"); byte[] decoded; try { - decoded = Base64.decode(base64Token); + decoded = java.util.Base64.getDecoder().decode(base64Token); } catch (IllegalArgumentException e) { throw new BadCredentialsException("Failed to decode basic authentication token"); }