Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bugs following change to ms_identity_python library #45

Open
shortydutchie opened this issue Nov 20, 2024 · 1 comment
Open

Comments

@shortydutchie
Copy link

It looks like this app has not been run/tested since someone changed the library to ms_identity_python

Can you please advise whether this instance is deprecated, ie. are there other options to authenticate through Django for a downstream request to an externa API? This lib looked quite neat.

In settings.py:
-there is no scopes keyword in an Auth object so this instantiation fails
-in settings.py, the following line does not work in INSTALLED_APPS as there is no app called 'identity'

"identity",  # To utilize the default templates came with the identity package

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

follow the documentation - there are a few bugs following the change to ms_identity_python and the example does not work

Any log messages given by the failure

various errors

Expected/desired behavior

app does not run

OS and Version?

Windows 8, 10, or 11. Linux (which distribution). macOS (Mojave? Catalina? Big Sur? Monterey?)
Linux (not relevant)

Versions

Django 4.0.2 python

Mention any other details that might be useful

In settings.py:
-there is no scopes keyword in an Auth object so this fails
-in settings.py, the following line does not work in INSTALLED_APPS as there is no app called 'identity'
"identity", # To utilize the default templates came with the identity package


Thanks! We'll be in touch soon.

@see7e
Copy link

see7e commented Dec 19, 2024

Mention any other details that might be useful

In settings.py: -there is no scopes keyword in an Auth object so this fails

TypeError: WebFrameworkAuth.init() got an unexpected keyword argument 'scopes'

Traceback (most recent call last):
  File "C:\path\to\django-web-app\manage.py", line 22, in <module>
    main()
  File "C:\Users\user\django-web-app\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\django\core\management\__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\django\conf\__init__.py", line 81, in __getattr__
    self._setup(name)
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\django\conf\__init__.py", line 68, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\django\conf\__init__.py", line 166, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked      
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed     
  File "C:\Users\user\django-web-app\mysite\settings.py", line 18, in <module>
    AUTH = Auth(
           ^^^^^
  File "C:\Users\user\django-web-app\venv\Lib\site-packages\ms_identity_python\django.py", line 38, in __init__
    super(Auth, self).__init__(*args, **kwargs)
TypeError: WebFrameworkAuth.__init__() got an unexpected keyword argument 'scopes'

Also tried to add a **kwargs argument at the WebFrameworkAuth class but it falls back to other listed issue:

  • in settings.py, the following line does not work in INSTALLED_APPS as there is no app called 'identity'
    identity", # To utilize the default templates came with the identity package

@shortydutchie I've created a fork of the repo to address to this last issue and resolve it for the Django application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants