diff --git a/src/djangosaml2_spid/management/commands/update_idps.py b/src/djangosaml2_spid/management/commands/update_idps.py index 395e178..96344ea 100644 --- a/src/djangosaml2_spid/management/commands/update_idps.py +++ b/src/djangosaml2_spid/management/commands/update_idps.py @@ -64,7 +64,8 @@ def download_identity_providers(self): indentation_level=1, ) - with requests.get(idp_metadata_url, verify=True) as response: + #Add User-Agent header to avoid 403 Forbidden error when downloading metadata from poste.it + with requests.get(idp_metadata_url, verify=True, headers={'User-Agent': ''}) as response: identity_provider["metadata"] = response.text self.print_success("All IdPs metadata downloaded successfully")