Skip to main content

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:

  1. Identity Providers used only for local (Wallet) authentication
  2. 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

ParameterDescriptionExample valueRequiredLocalizable
nameA human-readable name for the OAuth ProviderFPX-AlphaYesYes
clientIdThis value is used to identify the Wallet Server with the OAuth Provideridstore-walletYesNo
clientSecretA secret the Wallet Server uses with the OAuth Provider08d6e1f8-d771-4575-ba69-e38f6f0a2511YesNo
issuerUriThe base URL of the OAuth Providerhttps://fpxrs-alpha.rs.dev.identos.caYesNo
clientAuthenticationMethodThe 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_jwtNoNo
additionalRequestParamsAdditional 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" }NoNo

Data Source

ParameterDescriptionExample valueRequiredLocalizable
logoUrlA URL to fetch a logo image fromhttps://icons.iconarchive.com/icons/icons8/ios7/256/Science-Beta-icon.pngYesYes
styleColorA background color in the Wallet UI#FFFFFFYesYes
styleFontColorFont color in the Wallet UI#000000YesYes
resourceManagementApiModeA 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 informationDELEGATED_ONLYNoNo
RelationshipDescriptionRequired
organizationThe organization to which the Data Source belongs. See the example request above.Yes
oauthProviderThe OAuth Provider for this Data Source. See the example request above.Yes

OAuth Provider Custom Scopes (optional)

ParameterDescriptionExample valueRequiredLocalizable
scopesCustom 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 emailfpx_rot openidNoNo
RelationshipDescriptionRequired
oauthProviderThe 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.