Configure authentication specifications for Self-Serve Sources (Batch SDK)
Authentication specifications define how ÃÛ¶¹ÊÓƵ Experience Platform users can connect to your source.
The authSpec
array contains information on the authentication parameters required to connect a source to Platform. Any given source can support multiple different types of authentication.
Authentication specifications
Self-Serve Sources (Batch SDK) supports OAuth 2 refresh codes and basic authentication. See the tables below for guidance on using an OAuth 2 refresh code and basic authentication
OAuth 2 refresh code
An OAuth 2 refresh code allows for secure access to an application by generating a temporary access token and a refresh token. The access token allows you to securely access your resources without having to provide other credentials, while the refresh token allows you to generate a new access token, once the access token expires.
{
"name": "OAuth2 Refresh Code",
"type": "OAuth2RefreshCode",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Define auth params required for connecting to generic rest using oauth2 authorization code.",
"properties": {
"authorizationTestUrl": {
"description": "Authorization test url to validate accessToken.",
"type": "string"
},
"clientId": {
"description": "Client id of user account.",
"type": "string"
},
"clientSecret": {
"description": "Client secret of user account.",
"type": "string",
"format": "password"
},
"accessToken": {
"description": "Access Token",
"type": "string",
"format": "password"
},
"refreshToken": {
"description": "Refresh Token",
"type": "string",
"format": "password"
},
"expirationDate": {
"description": "Date of token expiry.",
"type": "string",
"format": "date",
"uiAttributes": {
"hidden": true
}
},
"accessTokenUrl": {
"description": "Access token url to fetch access token.",
"type": "string"
},
"requestParameterOverride": {
"type": "object",
"description": "Specify parameter to override.",
"properties": {
"accessTokenField": {
"description": "Access token field name to override.",
"type": "string"
},
"refreshTokenField": {
"description": "Refresh token field name to override.",
"type": "string"
},
"expireInField": {
"description": "ExpireIn field name to override.",
"type": "string"
},
"authenticationMethod": {
"description": "Authentication method override.",
"type": "string",
"enum": [
"GET",
"POST"
]
},
"clientId": {
"description": "ClientId field name override.",
"type": "string"
},
"clientSecret": {
"description": "ClientSecret field name override.",
"type": "string"
}
}
}
},
"required": [
"accessToken"
]
}
}
authSpec.name
oAuth2-refresh-code
authSpec.type
oAuth2-refresh-code
authSpec.spec
authSpec.spec.$schema
http://json-schema.org/draft-07/schema#
authSpec.spec.type
object
authSpec.spec.properties
authSpec.spec.properties.description
authSpec.spec.properties.type
string
authSpec.spec.properties.clientId
authSpec.spec.properties.clientSecret
authSpec.spec.properties.accessToken
authSpec.spec.properties.refreshToken
authSpec.spec.properties.expirationDate
authSpec.spec.properties.refreshTokenUrl
authSpec.spec.properties.accessTokenUrl
authSpec.spec.properties.requestParameterOverride
authSpec.spec.required
accessToken
Basic authentication
Basic authentication is an authentication type that allows you to access your application by using a combination of your account username and your account password.
{
"name": "Basic Authentication",
"type": "BasicAuthentication",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "defines auth params required for connecting to rest service.",
"properties": {
"username": {
"description": "Username to connect rest endpoint.",
"type": "string"
},
"password": {
"description": "Password to connect rest endpoint.",
"type": "string",
"format": "password"
}
},
"required": [
"username",
"password"
]
}
}
authSpec.name
Basic Authentication
authSpec.type
BasicAuthentication
authSpec.spec
authSpec.spec.$schema
http://json-schema.org/draft-07/schema#
authSpec.spec.type
object
authSpec.spec.description
authSpec.spec.properties
authSpec.spec.properties.username
authSpec.spec.properties.password
authSpec.spec.required
username
Example authentication specification
The following is an example of a completed authentication specification using a MailChimp Members source.
"authSpec": [
{
"name": "OAuth2 Refresh Code",
"type": "OAuth2RefreshCode",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Define auth params required for connecting to generic rest using oauth2 authorization code.",
"properties": {
"authorizationTestUrl": {
"description": "Authorization test url to validate accessToken.",
"type": "string"
},
"accessToken": {
"description": "Access Token of mailChimp endpoint.",
"type": "string",
"format": "password"
}
},
"required": [
"accessToken"
]
}
},
{
"name": "Basic Authentication",
"type": "BasicAuthentication",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "defines auth params required for connecting to rest service.",
"properties": {
"username": {
"description": "Username to connect mailChimp endpoint.",
"type": "string"
},
"password": {
"description": "Password to connect mailChimp endpoint.",
"type": "string",
"format": "password"
}
},
"required": [
"username",
"password"
]
}
}
],
Next steps
With your authentication specifications populated, you can proceed to configure the source specifications for the source that you want to integrate to Platform. See the document on configuring source specifications for more information.