public class BearerTokenAuthInterceptor extends Object implements ca.uhn.fhir.rest.client.api.IClientInterceptor
This interceptor adds a header resembling the following:
Authorization: Bearer dsfu9sd90fwp34.erw0-reu
where the token portion (at the end of the header) is supplied by the invoking code.
See the HAPI Documentation for information on how to use this class.
| Constructor and Description |
|---|
BearerTokenAuthInterceptor()
Constructor.
|
BearerTokenAuthInterceptor(String theToken)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getToken()
Returns the bearer token to use
|
void |
interceptRequest(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest) |
void |
interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) |
void |
setToken(String theToken)
Sets the bearer token to use
|
public BearerTokenAuthInterceptor()
public BearerTokenAuthInterceptor(String theToken)
theToken - The bearer token to use (must not be null)public void interceptRequest(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest)
interceptRequest in interface ca.uhn.fhir.rest.client.api.IClientInterceptorpublic void interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse)
interceptResponse in interface ca.uhn.fhir.rest.client.api.IClientInterceptorCopyright © 2014–2019 University Health Network. All rights reserved.