Class OAuth2ClientFilter

  • All Implemented Interfaces:
    javax.ws.rs.client.ClientRequestFilter

    @Priority(1000)
    class OAuth2ClientFilter
    extends java.lang.Object
    implements javax.ws.rs.client.ClientRequestFilter
    Client filter that adds access token to the Authorization http header. The filter uses bearer token specification.
    Since:
    2.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String accessToken  
    • Constructor Summary

      Constructors 
      Constructor Description
      OAuth2ClientFilter()
      Create a new filter with no default access token.
      OAuth2ClientFilter​(java.lang.String accessToken)
      Create a new filter with predefined access token.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void filter​(javax.ws.rs.client.ClientRequestContext request)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • accessToken

        private final java.lang.String accessToken
    • Constructor Detail

      • OAuth2ClientFilter

        public OAuth2ClientFilter​(java.lang.String accessToken)
        Create a new filter with predefined access token.
        Parameters:
        accessToken - Access token.
    • Method Detail

      • filter

        public void filter​(javax.ws.rs.client.ClientRequestContext request)
                    throws java.io.IOException
        Specified by:
        filter in interface javax.ws.rs.client.ClientRequestFilter
        Throws:
        java.io.IOException