private String getAuthTokenFromRequest ( HttpServletRequest httpRequest ) { String authToken = httpRequest . getHeader ( AUTH_TOKEN_HEADER_KEY ) ; if ( authToken == null ) { // token can also exist as request parameter authToken = httpRequest . getParameter ( AUTH_TOKEN_PARAMETER_KEY ) ; } return authToken ; }
Gets the authorization token from the request . First tries the header if that s empty the parameter is checked .