package com.myapp.auth;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
class TokenAuthenticationServiceImpl implements TokenAuthenticationService {

    private static final String AUTH_HEADER_NAME = "x-auth-token";

    private final TokenHandler tokenHandler;

    @Autowired
    TokenAuthenticationServiceImpl(TokenHandler tokenHandler) {
        this.tokenHandler = tokenHandler;
    }

    public Authentication getAuthentication(HttpServletRequest request) {
        final String token = request.getHeader(AUTH_HEADER_NAME);
        if (token == null || token.isEmpty()) return null;
        return tokenHandler
                .parseUserFromToken(token)
                .map(UserAuthentication::new)
                .orElse(null);
    }
}


@@ -324,76 +324,8 @@
  %7B%0A%0A
-    private static final String AUTH_HEADER_NAME = %22x-auth-token%22;%0A%0A
     
@@ -589,21 +589,26 @@
  String 
-token
+authHeader
  = reque
@@ -624,61 +624,198 @@
 der(
-AUTH_HEADER_NAME);%0A        if (token == null %7C%7C token
+%22authorization%22);%0A        if (authHeader == null) return null;%0A        if (!authHeader.startsWith(%22Bearer%22)) return null;%0A%0A        final String jwt = authHeader.substring(7);%0A        if (jwt
 .isE
@@ -827,32 +827,33 @@
 )) return null;%0A
+%0A
         return t
@@ -900,21 +900,19 @@
 omToken(
-token
+jwt
 )%0A      

use "Authorization: Bearer" when send request