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(IHttpRequest theRequest) |
void |
interceptResponse(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(IHttpRequest theRequest)
interceptRequest in interface IClientInterceptorpublic void interceptResponse(IHttpResponse theResponse)
interceptResponse in interface IClientInterceptorCopyright © 2014–2018 University Health Network. All rights reserved.