public int verify ( Request request , Response response ) { String authValue = request . getHeaders ( ) . getValues ( "Authorization" ) ; log . debug ( "Auth header value is: " + authValue ) ; if ( authValue == null ) { return Verifier . RESULT_MISSING ; } String [ ] tokenValues = authValue . split ( " " ) ; if ( tokenValues . length < 2 ) { return Verifier . RESULT_MISSING ; } if ( ! "Bearer" . equals ( tokenValues [ 0 ] ) ) { return Verifier . RESULT_INVALID ; } String token = tokenValues [ 1 ] ; log . debug ( "Token: " + token ) ; return checkToken ( token ) ; }
Verifies that the token passed is valid .