Class BearerAuthenticationInterceptor

  • All Implemented Interfaces:
    org.jboss.resteasy.spi.interception.AcceptedByMethod, org.jboss.resteasy.spi.interception.ClientExecutionInterceptor

    public class BearerAuthenticationInterceptor
    extends Object
    implements org.jboss.resteasy.spi.interception.ClientExecutionInterceptor, org.jboss.resteasy.spi.interception.AcceptedByMethod
    A Resteasy client interceptor used for Keycloak's client authentication based on the Bearer authentication method. It does not intercept the "grantToken" and "refreshToken" calls from the token service endpoint (those requests are basic authentication based).
    Since:
    0.9.0
    • Constructor Detail

      • BearerAuthenticationInterceptor

        public BearerAuthenticationInterceptor​(TokenManager tokenManager)
    • Method Detail

      • execute

        public org.jboss.resteasy.client.ClientResponse execute​(org.jboss.resteasy.spi.interception.ClientExecutionContext ctx)
                                                         throws Exception
        Specified by:
        execute in interface org.jboss.resteasy.spi.interception.ClientExecutionInterceptor
        Throws:
        Exception
      • accept

        public boolean accept​(Class declaring,
                              Method method)
        Specified by:
        accept in interface org.jboss.resteasy.spi.interception.AcceptedByMethod