The Java Virtual Machine (JVM) SDK only supports a single-user use case. For every individual user, the SDK must be instantiated with the user alias.
To instantiate the SDK.
Data4LifeClient client = Data4LifeClient.init( userAlias, clientId, clientSecret, environment, redirectUrl, secureStore, authorizationStore );
To start the OAuth 2.0 authorization flow.
// Open the authorization URL in the browser and let the user authorize String authorizationUrl = client.getAuthorizationUrl()
To finish the OAuth authorization flow by passing the OAuth callback URL with the code and state back to the SDK.
String callbackUrl = "https://.../oauth/callback?code=12345&state=abcde" boolean authorized = client.finishLogin(callbackUrl)
After the authorization finishes, the application can use the client to upload a document. To create a document with attachments with the
client.createRecord(record, customCreationDate, resultListener)
To extract the user ID from the callback URL after an OAuth login or registration, the SDK provides the
UserIdExtractor extractor = new UserIdExtractor(); String userId = extractor.extract(callbackUrl);