Class HttpBasicAuthenticationFeature

  • All Implemented Interfaces:
    javax.ws.rs.core.Feature

    public class HttpBasicAuthenticationFeature
    extends Object
    implements javax.ws.rs.core.Feature
    Authenticates the client with HTTP-Basic by adding the headers to the REST request. The credentials must be provided with the properties 'username' and 'password'.
    Since:
    6.1.1
    API:
    This is a public API.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.ws.rs.core.Feature basic​(String username, String password)
      Creates a HTTP Basic Auth header feature: for dynamic usage in third-party features.
    • Method Detail

      • basic

        public static javax.ws.rs.core.Feature basic​(String username,
                                                     String password)
        Creates a HTTP Basic Auth header feature: for dynamic usage in third-party features.

        You may use it to create HTTP Basic headers only for a single request (e.g. GET oauth/token). When generic enabling is neither required nor helpful.

        Since:
        9.2
        API:
        This public API is available in Java.