Configuring a Data Source
A Data Source represents any OAuth provider to the Wallet. Although the OAuth connection is unique, the entity may perform multiple roles within the FPX ecosystem, including different capabilities at different Authorization Servers. These roles include:
- Identity Providers used only for local (Wallet) authentication
- Resource Servers that can be put under management
Request Attributes
The API call to create a Data Source entry (shown below) also includes the creation of another entity that the Data Source depends on: OAuth Provider and OAuth Provider Custom Scopes. The attributes in this request are also described below according to the entity to which they belong.
OAuth Provider
Parameter | Description | Example value | Required | Localizable |
---|---|---|---|---|
name | A human-readable name for the OAuth Provider | FPX-Alpha | Yes | Yes |
clientId | This value is used to identify the Wallet Server with the OAuth Provider | idstore-wallet | Yes | No |
clientSecret | A secret the Wallet Server uses with the OAuth Provider | 08d6e1f8-d771-4575-ba69-e38f6f0a2511 | Yes | No |
issuerUri | The base URL of the OAuth Provider | https://fpxrs-alpha.rs.dev.identos.ca | Yes | No |
clientAuthenticationMethod | The authentication method the Wallet Server uses with the OAuth Provider. If left null, defaults to CLIENT_SECRET_BASIC. Currently the following values are supported: - client_secret_basic - client_secret_post - client_secret_jwt - private_key_jwt | private_key_jwt | No | No |
additionalRequestParams | Additional query parameters to include in OAuth authorization request made by the Wallet to the OAuth Provider. The JSON object is transformed to url query parameters e.g. the example value will render as '&custom=value&other_key=other_value' | { "custom":"value", "other_key":"other_value" } | No | No |
Data Source
Parameter | Description | Example value | Required | Localizable |
---|---|---|---|---|
logoUrl | A URL to fetch a logo image from | https://icons.iconarchive.com/icons/icons8/ios7/256/Science-Beta-icon.png | Yes | Yes |
styleColor | A background color in the Wallet UI | #FFFFFF | Yes | Yes |
styleFontColor | Font color in the Wallet UI | #000000 | Yes | Yes |
resourceManagementApiMode | A Data Source can be configured to use one of two procedures for connecting user Data Source Accounts. This can be set to ALL_RESOURCES or DELEGATED_ONLY. This value defaults to DELEGATED_ONLY if not set. See the documentation on the Resource Management API for more information | DELEGATED_ONLY | No | No |
Relationship | Description | Required |
---|---|---|
organization | The organization to which the Data Source belongs. See the example request above. | Yes |
oauthProvider | The OAuth Provider for this Data Source. See the example request above. | Yes |
OAuth Provider Custom Scopes (optional)
Parameter | Description | Example value | Required | Localizable |
---|---|---|---|---|
scopes | Custom scopes to be used in the OAuth authorization request from the Wallet to the OAuth Provider. Creating this entity is optional. If no custom scopes are created, the following OIDC scopes will be sent: openid , profile , and email | fpx_rot openid | No | No |
Relationship | Description | Required |
---|---|---|
oauthProvider | The OAuth Provider that these scopes will apply to. See the example request above. | Yes |
Sample Requests
Configure a new Data Source
curl -X PATCH '{{WS_ADMIN_URI}}' \
--header 'Content-Type: application/vnd.api+json; ext=jsonpatch' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en' \
--data-raw '[
{
"op": "add",
"path": "/oauth-provider",
"value": {
"type": "oauth-provider",
"id": 2,
"attributes": {
"name": "FPX-Alpha",
"clientId": "idstore-wallet",
"clientSecret": "08d6e1f8-d771-4575-ba69-e38f6f0a2511",
"issuerUri": "https://fpxrs-alpha.rs.dev.identos.ca",
"clientAuthenticationMethod": null,
"additionalRequestParams": {}
}
}
},
{
"op": "add",
"path": "oauth-provider/2/dataSource",
"value": {
"type": "data-source",
"id": 1,
"attributes": {
"logoUrl": "https://icons.iconarchive.com/icons/icons8/ios7/256/Science-Alpha-icon.png",
"styleColor": "#FFFFFF",
"styleFontColor": "#000000"
},
"relationships": {
"organization": {
"data": {
"type": "organization",
"id": 1
}
}
}
}
},
{
"op": "add",
"path": "/oauth-provider/2/customScopes",
"value": {
"type": "oauth-provider-custom-scopes",
"id": 1,
"attributes": {
"scopes": "fpx_rot openid"
}
}
}
]'
Get information about a Data Source
curl -X GET '{{WS_ADMIN_URI}}/data-source/1' \
--header 'Content-Type: application/vnd.api+json' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en'
Get information about OAuth Provider Custom Scopes
curl -X GET '{{WS_ADMIN_URI}}/oauth-provider/1/customScopes' \
--header 'Content-Type: application/vnd.api+json' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en'
Update a Data Source
curl -X PATCH '{{WS_ADMIN_URI}}' \
--header 'Content-Type: application/vnd.api+json; ext=jsonpatch' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en' \
--data-raw '[
{
"op": "replace",
"path": "/oauth-provider/2",
"value": {
"type": "oauth-provider",
"id": 2,
"attributes": {
"name": "FPX-Beta",
"clientId": "idstore-wallet",
"clientSecret": "08d6e1f8-d771-4575-ba69-e38f6f0a2511",
"issuerUri": "https://fpxrs-beta.rs.dev.identos.ca",
"clientAuthenticationMethod": null,
"additionalRequestParams": {}
}
}
},
{
"op": "replace",
"path": "/oauth-provider/2/dataSource/1",
"value": {
"type": "data-source",
"id": 1,
"attributes": {
"logoUrl": "https://icons.iconarchive.com/icons/icons8/ios7/256/Science-Beta-icon.png",
"styleColor": "#FFFFFF",
"styleFontColor": "#000000"
},
"relationships": {
"organization": {
"data": {
"type": "organization",
"id": 1
}
}
}
}
},
{
"op": "replace",
"path": "/oauth-provider/2/customScopes/1",
"value": {
"type": "oauth-provider-custom-scopes",
"id": 1,
"attributes": {
"scopes": "fpx_rot openid newscope"
}
}
}
]'
note
For details on how to add localization options for a Data Source, refer to the Localization for the Wallet Server API chapter.