public class GAuthAuthorizeBinding extends Object implements OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>
GoogleOAuthParameters
to a Camel Exchange
. This binding
is used by gauth:authorize
endpoints by default.Modifier and Type | Field and Description |
---|---|
static String |
GAUTH_CALLBACK
Name of the Camel header containing a callback URL.
|
static String |
GAUTH_SCOPE
Name of the Camel header defining the access scope.
|
Constructor and Description |
---|
GAuthAuthorizeBinding() |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Exchange |
readResponse(GAuthEndpoint endpoint,
org.apache.camel.Exchange exchange,
com.google.gdata.client.authn.oauth.GoogleOAuthParameters response)
Creates an
exchange.getOut() message that represents an HTTP
redirect to Google's OAuth confirmation page. |
com.google.gdata.client.authn.oauth.GoogleOAuthParameters |
writeRequest(GAuthEndpoint endpoint,
org.apache.camel.Exchange exchange,
com.google.gdata.client.authn.oauth.GoogleOAuthParameters request)
Creates a
GoogleOAuthParameters object from endpoint and
exchange.getIn() data. |
public static final String GAUTH_SCOPE
gauth:authorize
endpoint URI.public static final String GAUTH_CALLBACK
gauth:authorize
endpoint
URI.public com.google.gdata.client.authn.oauth.GoogleOAuthParameters writeRequest(GAuthEndpoint endpoint, org.apache.camel.Exchange exchange, com.google.gdata.client.authn.oauth.GoogleOAuthParameters request)
GoogleOAuthParameters
object from endpoint and
exchange.getIn()
data. The created parameter object is
used to fetch an unauthorized request token from Google.writeRequest
in interface OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>
endpoint
- exchange
- request
- ignored.public org.apache.camel.Exchange readResponse(GAuthEndpoint endpoint, org.apache.camel.Exchange exchange, com.google.gdata.client.authn.oauth.GoogleOAuthParameters response) throws Exception
exchange.getOut()
message that represents an HTTP
redirect to Google's OAuth confirmation page. Additionally, if the
GAuthComponent
is configured to use the HMAC_SHA1 signature
method, a cookie is created containing the request token secret. It is
needed later to upgrade an authorized request token to an access token.readResponse
in interface OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>
endpoint
- endpoint providing binding-relevant information.exchange
- exchange to be populated or created (if null
) from response data.response
- response to read data from.Exception
Apache Camel