public static class ServiceAccountCredentials.Builder extends Object
ServiceAccountCredentials instance.| Constructor and Description |
|---|
Builder()
Constructs a
Builder instance. |
| Modifier and Type | Method and Description |
|---|---|
ServiceAccountCredentials |
build()
Returns a new
ServiceAccountCredentials instance built from the current state of this builder. |
ServiceAccountCredentials.Builder |
fromFile(String credentialsFilePath)
Sets Service Account Credentials using the JSON credentials file path.
|
ServiceAccountCredentials.Builder |
withAccountId(String accountId)
Set Account Id (format: id@techacct.adobe.com)
|
ServiceAccountCredentials.Builder |
withClientId(String clientId)
Set Client ID (API Key)
|
ServiceAccountCredentials.Builder |
withClientSecret(String clientSecret)
Set Client Secret
|
ServiceAccountCredentials.Builder |
withOrganizationId(String organizationId)
Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to DC Services
|
ServiceAccountCredentials.Builder |
withPrivateKey(String privateKey)
Set private key
|
public ServiceAccountCredentials.Builder withClientId(String clientId)
clientId - Service Account ClientIDpublic ServiceAccountCredentials.Builder withClientSecret(String clientSecret)
clientSecret - Service Account Client Secretpublic ServiceAccountCredentials.Builder withPrivateKey(String privateKey)
privateKey - content of the private key file in PEM formatpublic ServiceAccountCredentials.Builder withOrganizationId(String organizationId)
organizationId - Service Account organizationIDpublic ServiceAccountCredentials.Builder withAccountId(String accountId)
accountId - Service Account IDpublic ServiceAccountCredentials.Builder fromFile(String credentialsFilePath) throws IOException
JSON structure:
{
"client_credentials": {
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET"
},
"service_account_credentials": {
"organization_id": "org_ident@AdobeOrg",
"account_id": "id@techacct.adobe.com",
"private_key_file": "private.key"
}
}
private_key_file is the path of private key file. It will be looked up in the classpath and the directory of JSON credentials file.credentialsFilePath - path to json credentials fileIOException - throws IOException due to parsing error or invalid file pathpublic ServiceAccountCredentials build()
ServiceAccountCredentials instance built from the current state of this builder.ServiceAccountCredentials instanceIllegalArgumentException - if any of clientId, clientSecret, privateKey, accountId and organizationId are not provided.Copyright © 2021 Adobe. All rights reserved.