Class BasicAuthInterceptor

java.lang.Object
ca.uhn.fhir.rest.client.interceptor.BasicAuthInterceptor
All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IClientInterceptor

public class BasicAuthInterceptor extends Object implements ca.uhn.fhir.rest.client.api.IClientInterceptor
HTTP interceptor to be used for adding HTTP basic auth username/password tokens to requests

See the HAPI Documentation for information on how to use this class.

  • Constructor Details

    • BasicAuthInterceptor

      public BasicAuthInterceptor(String theUsername, String thePassword)
      Parameters:
      theUsername - The username
      thePassword - The password
    • BasicAuthInterceptor

      public BasicAuthInterceptor(String theCredentialString)
      Parameters:
      theCredentialString - A credential string in the format username:password
  • Method Details

    • interceptRequest

      public void interceptRequest(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest)
      Specified by:
      interceptRequest in interface ca.uhn.fhir.rest.client.api.IClientInterceptor
    • interceptResponse

      public void interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) throws IOException
      Specified by:
      interceptResponse in interface ca.uhn.fhir.rest.client.api.IClientInterceptor
      Throws:
      IOException