Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response 403 Error for Authorization Header #4

Open
Pratik6609 opened this issue May 8, 2020 · 0 comments
Open

Response 403 Error for Authorization Header #4

Pratik6609 opened this issue May 8, 2020 · 0 comments

Comments

@Pratik6609
Copy link

Pratik6609 commented May 8, 2020

Hello Team,

Please check request data and suggest us if anything wrong.

Http Requests Data:

import json
import requests
import hashlib

#"API Key" as know as "client secret"

header = {
'Authorization': ,
'Accept': "application/json",
'Content-Type': 'application/json'

}

url = "https://api.uat.merchants.bankofmaldives.com.mv/public"

signature_data = "amount=1&currency=MVR&apiKey="

#We are using python hashlib lib for make signature using sha1
signature = hashlib.sha1(str.encode(signature_data))
signature = fingerprint.hexdigest()

data = {
"amount": 1,
"currency": "MVR",
"signature": signature,
"deviceId": "12345789",
"appVersion": "vendingSoftware1.0",
"apiVersion": "2.0",
"signMethod": "sha1",
'redirectUrl': "https://7355da23.ngrok.io",
"localId": "1234567890",
"customerReference": "invoice01",
}

request = requests.post(url, data=data, headers=header)

Request Response :
<Response [403]>

b'{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjhkMTg2M2NkLTczOWMtNGIyMC05NTlkLTkxMTMwMmE0ZDNiZSIsImNvbXBhbnlJZCI6IjVlYjA1Mjg2NGJlMzdjMDAwNzdkN2NjMyIsImlhdCI6MTU4ODYyNDM1NiwiZXhwIjo0NzQ0Mjk3OTU2fQ.C_THR9zDZXMS_nlfoREXVA_E5H-wdzjw0n-AHdcvYM0"}\n'

Your response will be highly appreciated.

Thanks,
Smith

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant