Authentication
There are two types of authentication used within SPF: basic authentication and OAuth 2.0 authentication (either with client credentials or a password). You can also choose to use neither.
SPF supports basic authentication for proxy endpoints and OAuth 2.0 and basic authentication for target endpoints. Both proxy and target endpoints accept an authentication type of NONE.
The authentication settings are set in the "webservice"
and "postback"
element within the "config"
object. The examples below walk through each of the different ways you can authenticate into SPF.
Webservice
Clients can choose to make a webservice request to the Symmetry Location Service through a proxy, which uses the NONE or BASIC types of authentication ("authType"
). Refer to the two examples below for the object models when configuring the webservice to use a proxy server.
"webservice": {
"enabled": true,
"continueIfUnsuccessful": true,
"useNormalizedAddress": true,
"showNormalizedAddressNotes": true,
"proxy": {
"authentication": {
"authType": "BASIC",
"username": "{ ENTER USERNAME HERE }",
"password": "{ ENTER PASSWORD HERE }"
},
"host": "{ ENTER PROXY HOST HERE }",
"port": "{ ENTER PROXY PORT HERE }"
}
}
"webservice": {
"enabled": true,
"continueIfUnsuccessful": true,
"useNormalizedAddress": true,
"showNormalizedAddressNotes": true,
"proxy": {
"authentication": {
"authType": "NONE"
},
"host": "{ ENTER PROXY HOST HERE }",
"port": "{ ENTER PROXY PORT HERE }"
}
}
Postback
Clients can choose to receive data directly to your target server, or through a proxy server. The target URL supports NONE, BASIC, and OAUTH2. If using a proxy server, SPF supports NONE or BASIC.
There are two types of oauth2 we support. Read more below on these OAuth 2.0 types.
Target Server
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "BASIC",
"username": "{ ENTER USERNAME HERE }",
"password": "{ ENTER PASSWORD HERE }"
}
},
"encryption": {
"enabled": false
},
"failureNotificationEmail": "{ ENTER POSTBACK FAILURE NOTIFICATION EMAIL HERE }"
}
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "NONE"
}
},
"encryption": {
"enabled": false
}
}
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "OAUTH2",
"oauth2GrantType": "CLIENT_CREDENTIALS",
"oauth2AuthServerUrl": "{ ENTER OAUTH AUTH TOKEN SERVER URL HERE }",
"oauth2ClientId": "{ ENTER CLIENT ID HERE }",
"oauth2ClientSecret": "{ ENTER CLIENT SECRET HERE }"
}
},
"encryption": {
"enabled": false
},
"failureNotificationEmail": "{ POSTBACK FAILURE NOTIFICATION EMAIL }"
}
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "OAUTH2",
"oauth2GrantType": "PASSWORD",
"oauth2AuthServerUrl": "{ ENTER OAUTH AUTH TOKEN SERVER URL HERE }",
"oauth2ClientId": "{ ENTER OAUTH CLIENT ID HERE }",
"oauth2ClientSecret": "{ ENTER OAUTH CLIENT SECRET HERE }",
"username": "{ ENTER OATH USERNAME HERE } ",
"password": "{ ENTER OATH PASSWORD HERE }"
}
},
"encryption": {
"enabled": false
},
"failureNotificationEmail": "{ ENTER POSTBACK FAILURE NOTIFICATION EMAIL HERE }"
}
Proxy Server
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "BASIC",
"username": "{ ENTER USERNAME HERE }",
"password": "{ ENTER PASSWORD HERE }"
}
},
"encryption": {
"enabled": false
},
"proxy": {
"authentication": {
"authType": "BASIC",
"username": "{ ENTER USERNAME HERE }",
"password": "{ ENTER PASSWORD HERE }"
},
"host": "{ ENTER PROXY HOST HERE }",
"port": "{ ENTER PROXY PORT HERE }"
},
"failureNotificationEmail": "{ ENTER POSTBACK FAILURE NOTIFICATION EMAIL HERE }"
}
"postback": {
"target": {
"url": "https://spf-test.symmetry.com:443/spf/postback-receive",
"authentication": {
"authType": "NONE"
}
},
"encryption": {
"enabled": false
},
"proxy": {
"authentication": {
"authType": "NONE"
},
"host": "{ ENTER PROXY HOST HERE }",
"port": "{ ENTER PROXY PORT HERE }"
},
"failureNotificationEmail": "{ ENTER POSTBACK FAILURE NOTIFICATION EMAIL HERE }"
}
Testing authentication configuration using Settings Builder
In addition to the examples above, clients can use Settings Builder to test different authentication settings to make a successful call to SPF. Read more about Settings Builder here.
SPF Registration Elements Defined
Clients can log into the Symmetry Client Support Center to see a full breakdown of the authentication schema elements.
Updated over 1 year ago