From 0e615920c58367978a307ea922750f274758b144 Mon Sep 17 00:00:00 2001 From: Dece2016 Date: Thu, 11 Jul 2019 14:29:51 +0800 Subject: [PATCH] java.util.Base64.getDecoder().decode( MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base64.decode()方法过时 --- .../app/authentication/ImoocAuthenticationSuccessHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); }