I see, python3-saml is using urllib in get_metadata classmethod of OneLogin_Saml2_IdPMetadataParser class.
Some urls are going fine through this method and we can access data in our code.
However, we have problems with some public urls and I do not see the reason denying it. Somewhy urllib , that you're using, is not accepting that url without User-Agent header. With User-Agent it works. It can be due to ModSecurity in urllib, where it checks if the request comes from a bot. But the url is parsed fine with curl and requests, however.
Could you please catch such 403 errors in some way, so we get this fixed on our side?
My example that worked:
request = Request('some-url.com', headers={'User-Agent': 'Mozilla/5.0'})
response = urlopen(req)
Thanks!
I see, python3-saml is using urllib in get_metadata classmethod of OneLogin_Saml2_IdPMetadataParser class.
Some urls are going fine through this method and we can access data in our code.
However, we have problems with some public urls and I do not see the reason denying it. Somewhy urllib , that you're using, is not accepting that url without User-Agent header. With User-Agent it works. It can be due to ModSecurity in urllib, where it checks if the request comes from a bot. But the url is parsed fine with curl and requests, however.
Could you please catch such 403 errors in some way, so we get this fixed on our side?
My example that worked:
Thanks!