Created
March 14, 2018 20:05
-
-
Save radutoev/0adbc959d67eb8f2f05a67631b76edd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
@Scope(scopeName = WebApplicationContext.SCOPE_REQUEST, | |
proxyMode = ScopedProxyMode.TARGET_CLASS) | |
public TokenString tokenString() { | |
HttpServletRequest request = ((ServletRequestAttributes) | |
RequestContextHolder | |
.currentRequestAttributes()) | |
.getRequest(); | |
String value = request.getHeader("Authorization").split(" ")[1]; | |
return new TokenString(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment