Use the ApplicationInstanceCreator class to create the initial ApplicationInstance class needed to instantiate the DistributedIDClient class. You need to call ApplicationInstanceCreator only once for the entire lifetime of the instance of the PingOne for Individuals Server SDK. This class follows a Builder pattern exposing methods that return the ApplicationInstanceCreator class. The build method creates an instance of the ApplicationInstance class.
The ApplicationInstanceCreator looks like this:
class ApplicationInstanceCreator {
ApplicationInstanceCreator withPingBaseUrl(String pingBaseUrl)
ApplicationInstanceCreator withJsonWebKeySet(JsonWebKeySet jsonWebKeySet)
ApplicationInstanceCreator withPushToken(String pushToken)
ApplicationInstanceCreator withCallbackURL(String callbackURL)
build() -> ApplicationInstance
}
void withPingBaseUrl(String pingBaseUrl)
The withPingBaseUrl
method sets the URL to use for server application callbacks. This can be:
https://api.pingone.com/v1/
(the default)https://api.pingone.ca/v1/
https://api.pingone.eu/v1/
https://api.pingone.asia/v1/
https://api-staging.pingone.com/v1/
https://api-test.pingone.com/v1/
void withJsonWebKeySet(JsonWebKeySet jsonWebKeySet)
The withJsonWebKeySet
method assigns the JWKS the application will use. You can use the JwksGenerator class to create a new key set:
JwksGenerator keySetGenerator = new JwksGenerator();
JsonWebKeySet jsonWebKeySet = keySetGenerator.generate();
void withPushToken(String pushToken)
The withPushToken
method assigns the string containing the push notification token. When creating an ApplicationInstance for a mobile application, a push notification token is required. This token is used to send notifications to the client using the Apple Push Notification service (APNS) or the Google Firebase service.
void withCallbackURL(String callbackURL)
The withCallbackURL
method assigns the string identifying the callback URL to use. When creating an ApplicationInstance object for a server instantiating the DistributedIDClient class, a callback URL is required. This URL is used by the ShoCard platform to notify the server application when messages are sent to the SDK.
The ID-routing service uses this callback URL if the server application has messages. For example, if the server application has a callback URL of https://example.com/callback?id=123
, the ID-routing service will call POST https://example.com/callback?id=123
to deliver messages. In this case, the request body will be empty, and the ID-routing service is expected to call DistributedIdClient.processMessages().