public class BearerTokenAuthInterceptor extends Object implements 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(org.apache.http.client.methods.HttpRequestBase theRequest)
Fired by the client just before invoking the HTTP client request
|
void |
interceptResponse(org.apache.http.HttpResponse theResponse)
Fired by the client upon receiving an HTTP response, prior to processing that response
|
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(org.apache.http.client.methods.HttpRequestBase theRequest)
IClientInterceptorinterceptRequest in interface IClientInterceptorpublic void interceptResponse(org.apache.http.HttpResponse theResponse)
IClientInterceptorinterceptResponse in interface IClientInterceptorCopyright © 2014–2016 University Health Network. All rights reserved.