public class OAuthAuthorization extends DefaultRequestAuth
AUTH_HEADER_NAME
Constructor and Description |
---|
OAuthAuthorization(OAuthDataController oAuth)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
initOAuthForRequest()
Initialize this auth.
|
void |
refresh()
Refresh the OAuth token.
|
void |
setAuth(IBoxRequest request)
Set Auth into the API request.
|
void |
setOAuthData(BoxOAuthToken data) |
public OAuthAuthorization(OAuthDataController oAuth)
oAuth
- OAuthautoRefresh
- Whether allow auto refresh the OAuth token when it's expired. Note you should only set this to true if you are making API calls in a single
threaded fashion. Multiple threads trying to auto refresh at a same time will cause trouble. In that case you should implement your own logic
to refresh synchronously.public void setOAuthData(BoxOAuthToken data)
public void refresh() throws AuthFatalFailureException
AuthFatalFailureException
- exceptionpublic void initOAuthForRequest()
public void setAuth(IBoxRequest request) throws BoxRestException, AuthFatalFailureException
IBoxRequestAuth
setAuth
in interface IBoxRequestAuth
setAuth
in class DefaultRequestAuth
request
- IBoxRequestBoxRestException
- Exception.AuthFatalFailureException
- exception