镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\username\\AppData\\Local\\Temp\\tmptgi2bs37.pem' #71

Open

Description

@Amr-Es

using it with pysaml2 gives this error
PermissionError: [Errno 13] Permission denied: 'C:\Users\username\AppData\Local\Temp\tmptgi2bs37.pem'
Full Trace

Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 344, in _loads
    self.response = self.signature_check(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1757, in correctly_signed_response
    self._check_signature(decoded_xml, response,
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1614, in _check_signature
    if self.verify_signature(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1428, in verify_signature
    return self.crypto.validate_signature(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1003, in validate_signature
    return xmlsec.verify(xml, cert_file)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 350, in verify
    return len(_verify(t, keyspec, sig_path)) > 0
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 312, in _verify
    this_cert = xmlsec.crypto.from_keyspec(keyspec, signature_element=sig)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 76, in from_keyspec
    key = _load_keyspec(keyspec, private, signature_element)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 255, in _load_keyspec
    return XMLSecCryptoFile(keyspec, private)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 141, in __init__
    with io.open(filename, "rb") as file:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'
XML parse error: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'
SAMLResponse Error
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\site-packages\djangosaml2\views.py", line 464, in post
    response = client.parse_authn_request_response(
  File "C:\Program Files\Python310\lib\site-packages\saml2\client_base.py", line 841, in parse_authn_request_response
    resp = self._parse_response(
  File "C:\Program Files\Python310\lib\site-packages\saml2\entity.py", line 1496, in _parse_response
    response = response.loads(xmlstr, False, origxml=xmlstr)
  File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 528, in loads
    self._loads(xmldata, decode, origxml)
  File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 344, in _loads
    self.response = self.signature_check(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1757, in correctly_signed_response
    self._check_signature(decoded_xml, response,
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1614, in _check_signature
    if self.verify_signature(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1428, in verify_signature
    return self.crypto.validate_signature(
  File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1003, in validate_signature
    return xmlsec.verify(xml, cert_file)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 350, in verify
    return len(_verify(t, keyspec, sig_path)) > 0
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 312, in _verify
    this_cert = xmlsec.crypto.from_keyspec(keyspec, signature_element=sig)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 76, in from_keyspec
    key = _load_keyspec(keyspec, private, signature_element)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 255, in _load_keyspec
    return XMLSecCryptoFile(keyspec, private)
  File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 141, in __init__
    with io.open(filename, "rb") as file:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'

Activity

  1. c00kiemon5ter commented on Jul 18, 2022

    @c00kiemon5ter
    Member

    @Amr-Es can you please paste the complete stacktrace? (including the command you used, if you're using this package as a script)

  2. Amr-Es commented on Jul 18, 2022

    @Amr-Es
    Author

    @c00kiemon5ter I'm using DjangoSaml2 which use pysaml2, below is the full trace

    Traceback (most recent call last):
      File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 344, in _loads
        self.response = self.signature_check(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1757, in correctly_signed_response
        self._check_signature(decoded_xml, response,
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1614, in _check_signature
        if self.verify_signature(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1428, in verify_signature
        return self.crypto.validate_signature(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1003, in validate_signature
        return xmlsec.verify(xml, cert_file)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 350, in verify
        return len(_verify(t, keyspec, sig_path)) > 0
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 312, in _verify
        this_cert = xmlsec.crypto.from_keyspec(keyspec, signature_element=sig)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 76, in from_keyspec
        key = _load_keyspec(keyspec, private, signature_element)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 255, in _load_keyspec
        return XMLSecCryptoFile(keyspec, private)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 141, in __init__
        with io.open(filename, "rb") as file:
    PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'
    XML parse error: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'
    SAMLResponse Error
    Traceback (most recent call last):
      File "C:\Program Files\Python310\lib\site-packages\djangosaml2\views.py", line 464, in post
        response = client.parse_authn_request_response(
      File "C:\Program Files\Python310\lib\site-packages\saml2\client_base.py", line 841, in parse_authn_request_response
        resp = self._parse_response(
      File "C:\Program Files\Python310\lib\site-packages\saml2\entity.py", line 1496, in _parse_response
        response = response.loads(xmlstr, False, origxml=xmlstr)
      File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 528, in loads
        self._loads(xmldata, decode, origxml)
      File "C:\Program Files\Python310\lib\site-packages\saml2\response.py", line 344, in _loads
        self.response = self.signature_check(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1757, in correctly_signed_response
        self._check_signature(decoded_xml, response,
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1614, in _check_signature
        if self.verify_signature(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1428, in verify_signature
        return self.crypto.validate_signature(
      File "C:\Program Files\Python310\lib\site-packages\saml2\sigver.py", line 1003, in validate_signature
        return xmlsec.verify(xml, cert_file)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 350, in verify
        return len(_verify(t, keyspec, sig_path)) > 0
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\__init__.py", line 312, in _verify
        this_cert = xmlsec.crypto.from_keyspec(keyspec, signature_element=sig)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 76, in from_keyspec
        key = _load_keyspec(keyspec, private, signature_element)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 255, in _load_keyspec
        return XMLSecCryptoFile(keyspec, private)
      File "C:\Program Files\Python310\lib\site-packages\xmlsec\crypto.py", line 141, in __init__
        with io.open(filename, "rb") as file:
    PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Amr\\AppData\\Local\\Temp\\tmps_abq_kj.pem'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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