com.sun.jersey.oauth.client
Class UnauthorizedRequestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sun.jersey.oauth.client.UnauthorizedRequestException
- All Implemented Interfaces:
- java.io.Serializable
public class UnauthorizedRequestException
- extends java.lang.RuntimeException
Thrown from a client request by the OAuthClientFilter
if
the request is not properly authorized. I.e. either when the user authorization
of a request token is required and has not been provided by the OAuthClientFilter.AuthHandler
or if the request token got revoked by the user - i.e. the verifier provided by the
OAuthClientFilter.AuthHandler
was either null or invalid.
In the first case, client may redirect user to the URI returned
from getAuthorizationUri()
.
Once authorization is obtained, client should add verifier code returned
by the server into OAuth parameters object returned from
getOAuthParameters()
.
In the second case getAuthorizationUri()
returns null.
- Author:
- Martin Matula
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UnauthorizedRequestException
public UnauthorizedRequestException(OAuthParameters parameters,
java.net.URI authorizationUri)
getOAuthParameters
public OAuthParameters getOAuthParameters()
- Returns OAuthParameters structure used by the
OAuthClientFilter
.
Can be used to update parameters to make the next request not fail (i.e. set a new
verification code).
- Returns:
- OAuth request parameters
getAuthorizationUri
public java.net.URI getAuthorizationUri()
- Returns authorization URI the user can be redirected to to provide authorization,
or null if there is no request token to be authorized (i.e. user revoked access
to the request token obtained by the client).
- Returns:
- authorization URI or null
Copyright © 2014 Oracle Corporation. All Rights Reserved.