Skip to content

Some urls come with 403 response #364

@galynazholtkevych

Description

@galynazholtkevych

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions