diff --git a/php/nordeawrapper.php b/php/nordeawrapper.php index cbb6b5b..d68923b 100644 --- a/php/nordeawrapper.php +++ b/php/nordeawrapper.php @@ -29,7 +29,7 @@ public function __construct() { $this->clientId = $ini_array['clientId']; $this->clientSecret = $ini_array['clientSecret']; $this->redirectUri = $ini_array['redirectUri']; - $this->authenticationUrl = $this->apiUrl . 'v1/authentication'; + $this->authenticationUrl = $this->apiUrl . 'v2/authorize'; $this->accessTokenUrl = $this->authenticationUrl . '/access_token'; $this->accountsUrl = $this->apiUrl . 'v2/accounts'; $this->paymentsUrl = $this->apiUrl . 'v2/payments/sepa'; @@ -64,7 +64,10 @@ private function curlRequest($url, $headers = null, $method = 'get', $payload = */ private function getCode() { $url = $this->authenticationUrl . '?client_id=' . $this->clientId - . '&redirect_uri=' . $this->redirectUri . '&state='; + . '&redirect_uri=' . $this->redirectUri + . '&state=oauth2' + . '&scope=ACCOUNTS_BASIC,ACCOUNTS_BALANCES,ACCOUNTS_DETAILS,ACCOUNTS_TRANSACTIONS,PAYMENTS_MULTIPLE' + . '&duration=1234'; $response = $this->curlRequest($url); $body = substr($response, $curl_info['header_size']); diff --git a/python/generate_access_token.py b/python/generate_access_token.py index 9be1818..596263d 100644 --- a/python/generate_access_token.py +++ b/python/generate_access_token.py @@ -4,7 +4,7 @@ API_URI = 'https://api.nordeaopenbanking.com/' CLIENT_ID = 'your client id here' CLIENT_SECRET = 'your client secret here' -REDIRECT_URI = 'http://httpbin.org/get' +REDIRECT_URI = 'https://httpbin.org/' """ This is an example how to generate the access token from the scratch. @@ -14,11 +14,13 @@ """ def get_code(): - endpoint = 'v1/authentication' + endpoint = 'v2/authorize' payload = { 'client_id': CLIENT_ID, - 'redirect_uri': REDIRECT_URI, - 'state': '' + 'redirect_uri': REDIRECT_URI + 'get', + 'state': 'oauth2', + 'scope': 'ACCOUNTS_BASIC,ACCOUNTS_BALANCES,ACCOUNTS_DETAILS,ACCOUNTS_TRANSACTIONS,PAYMENTS_MULTIPLE', + 'duration': '1234' } r = requests.get(API_URI + endpoint, params=payload) if not r.status_code == requests.codes.ok: @@ -29,7 +31,7 @@ def get_code(): def get_access_token(code): - endpoint = 'v1/authentication/access_token' + endpoint = 'v2/authorize/access_token' headers = { 'Content-Type': 'application/x-www-form-urlencoded', 'X-IBM-Client-Id': CLIENT_ID, @@ -38,7 +40,7 @@ def get_access_token(code): payload = { 'code': code, - 'redirect_uri': REDIRECT_URI + 'redirect_uri': REDIRECT_URI + 'post' } r = requests.post(API_URI + endpoint, data=payload, headers=headers) if not r.status_code == requests.codes.ok: