Open ShaimaaSabry opened 3 years ago
Here is my PeerAuthenticator class:
public class TokenPeerAuthenticator implements PeerAuthenticator { Configuration configuration = Configuration.get(); @Override public boolean authenticate(HttpServletRequest request) { String requiredToken = configuration.getAuthToken(); String authorizationHeader = request.getHeader("Authorization"); if(authorizationHeader == null) { return false; } String token = authorizationHeader.replace("Bearer ", ""); if(token.equals(requiredToken)) { return true; } return false; } }
and this my API:
@Api(name = "api", version = "v1", peerAuthenticators = TokenPeerAuthenticator.class) public class UserAPI { ... }
My PeerAuthenticator is not getting called. Please advice.
Here is my PeerAuthenticator class:
and this my API:
My PeerAuthenticator is not getting called. Please advice.