Authorization header not found
See original GitHub issueHello, I was trying to login on SAP B1 but I’m always getting an error ‘Authorization header not found’. Here is my code
import pyodata
import requests
SERVICE_URL=https://192.168.xx.xx:50000/b1s/v1
s = requests.Session()
s.verify = False
s.post(service_url+'/Login', headers={
"CompanyDB": SAPDEMO,
"Password": mypassword,
"UserName": myusername
})
client = pyodata.Client(SERVICE_URL, s)
print(client)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Getting '403 Authorization header not found' when request a ...
Hi. I'm trying to get this plugin work on a blank WP. .htaccess is set wp-config.php is set. When I'm trying to get...
Read more >Authorization header missing in PHP POST request
The Authorization header is populated with a token. It seems the Authorization header is somehow removed before it arrives at my PHP script....
Read more >Why authorization header not included in request ? - Auth0
Whenever I make this request with valid token from the browser it throws 401 error. With the same token, I call this endpoint...
Read more >Fix Site Health Error: The authorization header is missing
Quick post that explains how to fix the error, “The authorization header is missing”. This error may be found under “recommended improvements” ......
Read more >The Authorization Header is Missing - Really Simple SSL
The problem appears to be that Apache does not automatically send authorization headers. If that happens, the header has to be enabled in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK thanks, I didn’t read properly the console log but it seems I have found the problem.
Your $metadata file declares` <edmx:DataServices m:DataServiceVersion=“3.0” m:MaxDataServiceVersion=“3.0”> which is Odata Version 3. Pyodata so far supports only Odata v2 - support for v4 (together with v3) is pending; watch https://github.com/SAP/python-pyodata/issues/39
If you are not forced to use python, I can recommend our “sibling” library from nodejs world, https://github.com/SAP/odata-library, which does support odata v1-4.
Hi @julzpalomiano - ok, it is valid XML response. Could you anyway pls create PR to the https://github.com/phanak-sap/pyodata-issue-files with the XML of the $metadata (you can use the URL https://192.168.xx.xx:50000/b1s/v1$metadata in the browser to see the XML file). Saves the time with the re-formatting/trimming from console output