Depending on the HTTP library you use, you may need a different provider type, refer to the website documentation for how to do that.
To receive a request token which the user must authorize, you invoke it using a consumer instance and a callback URL:
String url = provider.retrieveRequestToken(consumer, "http://www.example.com/callback");
That url must be opened in a Web browser, where the user can grant access to the resources in question. If that succeeds, the service provider will redirect to the callback URL and append the blessed request token.
That token must now be exchanged for an access token, as such:
provider.retrieveAccessToken(consumer, nullOrVerifierCode);
where nullOrVerifierCode is either null if your provided a callback URL in the previous step, or the pin code issued by the service provider to the user if the request was out-of-band (cf. {@link OAuth#OUT_OF_BAND}.
The consumer used during token handshakes is now ready for signing.
@see DefaultOAuthProvider @see DefaultOAuthConsumer @see OAuthProviderListener
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|