question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authorization header not found

See original GitHub issue

Hello, 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:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
phanak-sapcommented, Jun 26, 2021

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.

1reaction
phanak-sapcommented, Jun 26, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found