Skip to content

Latest commit

 

History

History
841 lines (617 loc) · 39.2 KB

RoleApi.md

File metadata and controls

841 lines (617 loc) · 39.2 KB

obp_python.RoleApi

All URIs are relative to http://test.openbankproject.com

Method HTTP request Description
o_bpv2_0_0_add_entitlement POST /obp/v5.0.0/users/{USER_ID}/entitlements Add Entitlement for a User
o_bpv2_0_0_delete_entitlement DELETE /obp/v5.0.0/users/{USER_ID}/entitlement/{ENTITLEMENT_ID} Delete Entitlement
o_bpv2_1_0_get_entitlements_by_bank_and_user GET /obp/v5.0.0/banks/{BANK_ID}/users/{USER_ID}/entitlements Get Entitlements for User at Bank
o_bpv2_1_0_get_roles GET /obp/v5.0.0/roles Get Roles
o_bpv3_0_0_add_entitlement_request POST /obp/v5.0.0/entitlement-requests Create Entitlement Request for current User
o_bpv3_0_0_delete_entitlement_request DELETE /obp/v5.0.0/entitlement-requests/{ENTITLEMENT_REQUEST_ID} Delete Entitlement Request
o_bpv3_0_0_get_all_entitlement_requests GET /obp/v5.0.0/entitlement-requests Get all Entitlement Requests
o_bpv3_0_0_get_entitlement_requests GET /obp/v5.0.0/users/{USER_ID}/entitlement-requests Get Entitlement Requests for a User
o_bpv3_0_0_get_entitlement_requests_for_current_user GET /obp/v5.0.0/my/entitlement-requests Get Entitlement Requests for the current User
o_bpv3_0_0_get_entitlements_for_current_user GET /obp/v5.0.0/my/entitlements Get Entitlements for the current User
o_bpv3_1_0_get_all_entitlements GET /obp/v5.0.0/entitlements Get all Entitlements
o_bpv4_0_0_create_user_with_roles POST /obp/v5.0.0/user-entitlements Create (DAuth) User with Roles
o_bpv4_0_0_get_entitlements GET /obp/v5.0.0/users/{USER_ID}/entitlements Get Entitlements for User
o_bpv4_0_0_get_entitlements_for_bank GET /obp/v5.0.0/banks/{BANK_ID}/entitlements Get Entitlements for One Bank

o_bpv2_0_0_add_entitlement

EntitlementJSON o_bpv2_0_0_add_entitlement(body, user_id)

Add Entitlement for a User

Create Entitlement. Grant Role to User.

Entitlements are used to grant System or Bank level roles to Users. (For Account level privileges, see Views)

For a System level Role (.e.g CanGetAnyUser), set bank_id to an empty string i.e. "bank_id":""

For a Bank level Role (e.g. CanCreateAccount), set bank_id to a valid value e.g. "bank_id":"my-bank-id"

Authentication is required and the user needs to be a Super Admin. Super Admins are listed in the Props file.

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.CreateEntitlementJSON() # CreateEntitlementJSON | CreateEntitlementJSON object that needs to be added.
user_id = 'user_id_example' # str | The user id

try:
    # Add Entitlement for a User
    api_response = api_instance.o_bpv2_0_0_add_entitlement(body, user_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv2_0_0_add_entitlement: %s\n" % e)

Parameters

Name Type Description Notes
body CreateEntitlementJSON CreateEntitlementJSON object that needs to be added.
user_id str The user id

Return type

EntitlementJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv2_0_0_delete_entitlement

EmptyClassJson o_bpv2_0_0_delete_entitlement(body, entitlement_id, user_id)

Delete Entitlement

Delete Entitlement specified by ENTITLEMENT_ID for an user specified by USER_ID

Authentication is required and the user needs to be a Super Admin.
Super Admins are listed in the Props file.

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.
entitlement_id = 'entitlement_id_example' # str | The entitblement id
user_id = 'user_id_example' # str | The user id

try:
    # Delete Entitlement
    api_response = api_instance.o_bpv2_0_0_delete_entitlement(body, entitlement_id, user_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv2_0_0_delete_entitlement: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.
entitlement_id str The entitblement id
user_id str The user id

Return type

EmptyClassJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv2_1_0_get_entitlements_by_bank_and_user

EntitlementJSONs o_bpv2_1_0_get_entitlements_by_bank_and_user(body, user_id, bank_id)

Get Entitlements for User at Bank

Get Entitlements specified by BANK_ID and USER_ID

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.
user_id = 'user_id_example' # str | The user id
bank_id = 'bank_id_example' # str | The bank id

try:
    # Get Entitlements for User at Bank
    api_response = api_instance.o_bpv2_1_0_get_entitlements_by_bank_and_user(body, user_id, bank_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv2_1_0_get_entitlements_by_bank_and_user: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.
user_id str The user id
bank_id str The bank id

Return type

EntitlementJSONs

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv2_1_0_get_roles

AvailableRolesJSON o_bpv2_1_0_get_roles(body)

Get Roles

Returns all available roles

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.

try:
    # Get Roles
    api_response = api_instance.o_bpv2_1_0_get_roles(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv2_1_0_get_roles: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.

Return type

AvailableRolesJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_add_entitlement_request

EntitlementRequestJSON o_bpv3_0_0_add_entitlement_request(body)

Create Entitlement Request for current User

Create Entitlement Request.

Any logged in User can use this endpoint to request an Entitlement

Entitlements are used to grant System or Bank level roles to Users. (For Account level privileges, see Views)

For a System level Role (.e.g CanGetAnyUser), set bank_id to an empty string i.e. "bank_id":""

For a Bank level Role (e.g. CanCreateAccount), set bank_id to a valid value e.g. "bank_id":"my-bank-id"

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.CreateEntitlementJSON() # CreateEntitlementJSON | CreateEntitlementJSON object that needs to be added.

try:
    # Create Entitlement Request for current User
    api_response = api_instance.o_bpv3_0_0_add_entitlement_request(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_add_entitlement_request: %s\n" % e)

Parameters

Name Type Description Notes
body CreateEntitlementJSON CreateEntitlementJSON object that needs to be added.

Return type

EntitlementRequestJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_delete_entitlement_request

o_bpv3_0_0_delete_entitlement_request(entitlement_request_id)

Delete Entitlement Request

Delete the Entitlement Request specified by ENTITLEMENT_REQUEST_ID for a user specified by USER_ID

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
entitlement_request_id = 'entitlement_request_id_example' # str | the entitlement request id

try:
    # Delete Entitlement Request
    api_instance.o_bpv3_0_0_delete_entitlement_request(entitlement_request_id)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_delete_entitlement_request: %s\n" % e)

Parameters

Name Type Description Notes
entitlement_request_id str the entitlement request id

Return type

void (empty response body)

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_get_all_entitlement_requests

EntitlementRequestsJSON o_bpv3_0_0_get_all_entitlement_requests()

Get all Entitlement Requests

Get all Entitlement Requests

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))

try:
    # Get all Entitlement Requests
    api_response = api_instance.o_bpv3_0_0_get_all_entitlement_requests()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_get_all_entitlement_requests: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

EntitlementRequestsJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_get_entitlement_requests

EntitlementRequestsJSON o_bpv3_0_0_get_entitlement_requests(user_id)

Get Entitlement Requests for a User

Get Entitlement Requests for a User.

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
user_id = 'user_id_example' # str | The user id

try:
    # Get Entitlement Requests for a User
    api_response = api_instance.o_bpv3_0_0_get_entitlement_requests(user_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_get_entitlement_requests: %s\n" % e)

Parameters

Name Type Description Notes
user_id str The user id

Return type

EntitlementRequestsJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_get_entitlement_requests_for_current_user

EntitlementRequestsJSON o_bpv3_0_0_get_entitlement_requests_for_current_user()

Get Entitlement Requests for the current User

Get Entitlement Requests for the current User.

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))

try:
    # Get Entitlement Requests for the current User
    api_response = api_instance.o_bpv3_0_0_get_entitlement_requests_for_current_user()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_get_entitlement_requests_for_current_user: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

EntitlementRequestsJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_get_entitlements_for_current_user

EntitlementJSONs o_bpv3_0_0_get_entitlements_for_current_user()

Get Entitlements for the current User

Get Entitlements for the current User.

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))

try:
    # Get Entitlements for the current User
    api_response = api_instance.o_bpv3_0_0_get_entitlements_for_current_user()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_0_0_get_entitlements_for_current_user: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

EntitlementJSONs

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_1_0_get_all_entitlements

EntitlementJSONs o_bpv3_1_0_get_all_entitlements()

Get all Entitlements

Login is required.

Possible filter on the role field:

eg: /entitlements?role=CanGetCustomer

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))

try:
    # Get all Entitlements
    api_response = api_instance.o_bpv3_1_0_get_all_entitlements()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv3_1_0_get_all_entitlements: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

EntitlementJSONs

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv4_0_0_create_user_with_roles

EntitlementsJsonV400 o_bpv4_0_0_create_user_with_roles(body)

Create (DAuth) User with Roles

This endpoint is used as part of the DAuth solution to grant Entitlements for Roles to a smart contract on the blockchain.

Put the smart contract address in username

For provider use "dauth"

This endpoint will create the User with username and provider if the User does not already exist.

Then it will create Entitlements i.e. grant Roles to the User.

Entitlements are used to grant System or Bank level roles to Users. (For Account level privileges, see Views)

i.e. Entitlements are used to create / consume system or bank level resources where as views / account access are used to consume / create customer level resources.

For a System level Role (.e.g CanGetAnyUser), set bank_id to an empty string i.e. "bank_id":""

For a Bank level Role (e.g. CanCreateAccount), set bank_id to a valid value e.g. "bank_id":"my-bank-id"

Note: The Roles actually granted will depend on the Roles that the calling user has.

If you try to grant Entitlements to a user that already exist (duplicate entitilements) you will get an error.

For information about DAuth see below:

DAuth

DAuth is an experimental authentication mechanism that aims to pin an ethereum or other blockchain Smart Contract to an OBP "User".

In the future, it might be possible to be more specific and pin specific actors (wallets) that are acting within the smart contract, but so far, one smart contract acts on behalf of one User.

Thus, if a smart contract "X" calls the OBP API using the DAuth header, OBP will get or create a user called X and the call will proceed in the context of that User "X".

DAuth is invoked by the REST client (caller) including a specific header (see step 3 below) in any OBP REST call.

When OBP receives the DAuth token, it creates or gets a User with a username based on the smart_contract_address and the provider based on the network_name. The combination of username and provider is unique in OBP.

If you are calling OBP-API via an API3 Airnode, the Airnode will take care of constructing the required header.

When OBP detects a DAuth header / token it first checks if the Consumer is allowed to make such a call. OBP will validate the Consumer ip address and signature etc.

Note: The DAuth flow does not require an explicit POST like Direct Login to create the token.

Permissions may be assigned to an OBP User at any time, via the UserAuthContext, Views, Entitlements to Roles or Consents.

Note: DAuth is NOT enabled on this instance!

Note: The DAuth client is responsible for creating a token which will be trusted by OBP absolutely!

To use DAuth:

Set up properties in your props file

# -- DAuth --------------------------------------# Define secret used to validate JWT token# jwt.public_key_rsa=path-to-the-pem-file# Enable/Disable DAuth communication at all# In case isn't defined default value is false# allow_dauth=false# Define comma separated list of allowed IP addresses# dauth.host=127.0.0.1# -------------------------------------- DAuth--

Please keep in mind that property jwt.public_key_rsa is used to validate JWT token to check it is not changed or corrupted during transport.

The following videos are available:
* DAuth in local environment

HEADER:ALGORITHM & TOKEN TYPE

{  "alg": "RS256",  "typ": "JWT"}

PAYLOAD:DATA

{  "smart_contract_address": "0xe123425E7734CE288F8367e1Bb143E90bb3F051224",  "network_name": "AIRNODE.TESTNET.ETHEREUM",  "msg_sender": "0xe12340927f1725E7734CE288F8367e1Bb143E90fhku767",  "consumer_key": "0x1234a4ec31e89cea54d1f125db7536e874ab4a96b4d4f6438668b6bb10a6adb",  "timestamp": "2021-11-04T14:13:40Z",  "request_id": "0Xe876987694328763492876348928736497869273649"}

VERIFY SIGNATURE

RSASHA256(  base64UrlEncode(header) + "." +  base64UrlEncode(payload),

) your-RSA-key-pair

Here is an example token:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFydF9jb250cmFjdF9hZGRyZXNzIjoiMHhlMTIzNDI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGJiM0YwNTEyMjQiLCJuZXR3b3JrX25hbWUiOiJFVEhFUkVVTSIsIm1zZ19zZW5kZXIiOiIweGUxMjM0MDkyN2YxNzI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGZoa3U3NjciLCJjb25zdW1lcl9rZXkiOiIweDEyMzRhNGVjMzFlODljZWE1NGQxZjEyNWRiNzUzNmU4NzRhYjRhOTZiNGQ0ZjY0Mzg2NjhiNmJiMTBhNmFkYiIsInRpbWVzdGFtcCI6IjIwMjEtMTEtMDRUMTQ6MTM6NDBaIiwicmVxdWVzdF9pZCI6IjBYZTg3Njk4NzY5NDMyODc2MzQ5Mjg3NjM0ODkyODczNjQ5Nzg2OTI3MzY0OSJ9.XSiQxjEVyCouf7zT8MubEKsbOBZuReGVhnt9uck6z6k

Using your favorite http client:

GET https://test.openbankproject.com/obp/v3.0.0/users/current

Body

Leave Empty!

Headers:

   DAuth: your-jwt-from-step-above

Here is it all together:

GET https://test.openbankproject.com/obp/v3.0.0/users/current HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.47.0
Accept: /
DAuth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFydF9jb250cmFjdF9hZGRyZXNzIjoiMHhlMTIzNDI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGJiM0YwNTEyMjQiLCJuZXR3b3JrX25hbWUiOiJFVEhFUkVVTSIsIm1zZ19zZW5kZXIiOiIweGUxMjM0MDkyN2YxNzI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGZoa3U3NjciLCJjb25zdW1lcl9rZXkiOiIweDEyMzRhNGVjMzFlODljZWE1NGQxZjEyNWRiNzUzNmU4NzRhYjRhOTZiNGQ0ZjY0Mzg2NjhiNmJiMTBhNmFkYiIsInRpbWVzdGFtcCI6IjIwMjEtMTEtMDRUMTQ6MTM6NDBaIiwicmVxdWVzdF9pZCI6IjBYZTg3Njk4NzY5NDMyODc2MzQ5Mjg3NjM0ODkyODczNjQ5Nzg2OTI3MzY0OSJ9.XSiQxjEVyCouf7zT8MubEKsbOBZuReGVhnt9uck6z6k

CURL example

curl -v -H 'DAuth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFydF9jb250cmFjdF9hZGRyZXNzIjoiMHhlMTIzNDI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGJiM0YwNTEyMjQiLCJuZXR3b3JrX25hbWUiOiJFVEhFUkVVTSIsIm1zZ19zZW5kZXIiOiIweGUxMjM0MDkyN2YxNzI1RTc3MzRDRTI4OEY4MzY3ZTFCYjE0M0U5MGZoa3U3NjciLCJjb25zdW1lcl9rZXkiOiIweDEyMzRhNGVjMzFlODljZWE1NGQxZjEyNWRiNzUzNmU4NzRhYjRhOTZiNGQ0ZjY0Mzg2NjhiNmJiMTBhNmFkYiIsInRpbWVzdGFtcCI6IjIwMjEtMTEtMDRUMTQ6MTM6NDBaIiwicmVxdWVzdF9pZCI6IjBYZTg3Njk4NzY5NDMyODc2MzQ5Mjg3NjM0ODkyODczNjQ5Nzg2OTI3MzY0OSJ9.XSiQxjEVyCouf7zT8MubEKsbOBZuReGVhnt9uck6z6k' https://test.openbankproject.com/obp/v3.0.0/users/current

You should receive a response like:

{    "user_id": "4c4d3175-1e5c-4cfd-9b08-dcdc209d8221",    "email": "",    "provider_id": "0xe123425E7734CE288F8367e1Bb143E90bb3F051224",    "provider": "ETHEREUM",    "username": "0xe123425E7734CE288F8367e1Bb143E90bb3F051224",    "entitlements": {        "list": []    }}

The file, dauth.scala handles the DAuth,

We:

-> Check if Props allow_dauth is true  -> Check if DAuth header exists    -> Check if getRemoteIpAddress is OK      -> Look for "token"        -> parse the JWT token and getOrCreate the user          -> get the data of the user

Parameter names and values are case sensitive.
Each parameter MUST NOT appear more than once per request.



Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
body = obp_python.PostCreateUserWithRolesJsonV400() # PostCreateUserWithRolesJsonV400 | PostCreateUserWithRolesJsonV400 object that needs to be added.

try:
    # Create (DAuth) User with Roles
    api_response = api_instance.o_bpv4_0_0_create_user_with_roles(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv4_0_0_create_user_with_roles: %s\n" % e)

Parameters

Name Type Description Notes
body PostCreateUserWithRolesJsonV400 PostCreateUserWithRolesJsonV400 object that needs to be added.

Return type

EntitlementsJsonV400

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv4_0_0_get_entitlements

EntitlementsJsonV400 o_bpv4_0_0_get_entitlements(user_id)

Get Entitlements for User

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
user_id = 'user_id_example' # str | The user id

try:
    # Get Entitlements for User
    api_response = api_instance.o_bpv4_0_0_get_entitlements(user_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv4_0_0_get_entitlements: %s\n" % e)

Parameters

Name Type Description Notes
user_id str The user id

Return type

EntitlementsJsonV400

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv4_0_0_get_entitlements_for_bank

EntitlementsJsonV400 o_bpv4_0_0_get_entitlements_for_bank(bank_id)

Get Entitlements for One Bank

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.RoleApi(obp_python.ApiClient(configuration))
bank_id = 'bank_id_example' # str | The bank id

try:
    # Get Entitlements for One Bank
    api_response = api_instance.o_bpv4_0_0_get_entitlements_for_bank(bank_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RoleApi->o_bpv4_0_0_get_entitlements_for_bank: %s\n" % e)

Parameters

Name Type Description Notes
bank_id str The bank id

Return type

EntitlementsJsonV400

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]