API Explorer

Consumer Account Access

Consumer Account Access

OBP has two layers of permission. Roles say which endpoints may be called. They are granted to a User as Entitlements and to a Consumer as Scopes. Account access says which accounts may be used, and through which view. It is granted to a User, and with Consumer Account Access also to a Consumer.

It is for an application that acts on an account as itself, with its own application token (OAuth2 client credentials), when no person is involved. An example is a bank's service that relays customers' payments and initiates them from the bank's own account. Without it, such a service has to log in as a stand-in User who holds the account access.

How it works

  1. Someone who may grant views of the account gives the Consumer access to a view. Their own view must list the target view in can_grant_access_to_views, or have can_grant_access_to_custom_views for a custom view. The grant records who gave it.
  2. The application calls an endpoint of that view with its client-credentials token. Its User is then the Consumer's own: provider obp-oidc#client (or keycloak#client for a Keycloak service account), named after the client id. OBP then finds the Consumer's grant.
  3. The Consumer must be a Platform App. The grant then works like a person's access to the view, on every endpoint that uses the view.

A person who logs in through the same Consumer does not get the Consumer's account access. Nor does a caller identified only by the Consumer Key. Only the client-credentials token proves that the application is calling as itself.

Which view

The owner view and public views can't be granted to a Consumer. Holding an account is for people. Give the Consumer a view with only the permissions it needs. For initiating payments, that is a custom view with can_add_transaction_request_to_any_account. Create it with Create Custom View (Management), POST /obp/v6.0.0/management/banks/BANK_ID/accounts/ACCOUNT_ID/views (Role CanCreateCustomView). Grant it through the ManageCustomViews system view, which has can_grant_access_to_custom_views. The account holder can give ManageCustomViews through owner. The Transaction Requests the Consumer creates record it.

Endpoints

See also here.