Prepare a Callback
Using the Java SDK
Prepare a Callback (back to all tutorials)
Most Veriplace API calls use the OAuth redirect and callback process. Before your application can make these calls, it must specify a URL for this callback.
-
Option 1: Hardcode a Callback
The simplest approach is to hardcode your callback to a fixed URL:
-
Option 2: Determine Callback from HttpServletRequest
In many cases, you will want to generate a callback that refers back to the same server (host and port) that initiated the request. The SDK offers any easy way to construct such a callback from an HttpServletRequest:
The boolean argument in this example controls whether the callback includes path information from the request; you can override this and other callback behavior by using the com.veriplace.client.factory.DefaultCallbackFactory directly:
-
Option 3: Define a CallbackFactory
If you wish to configure a callback through some other mechanism, you can implement your own version of com.veriplace.client.factory.CallbackFactory. This is particularly useful in conjuction with the Verplace web framework.