Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

PeerAuthenticator not getting called #203

@ShaimaaSabry

Description

@ShaimaaSabry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions