Git Product home page Git Product logo

auth0-django-web-app's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auth0-django-web-app's Issues

Exception during the second login using different accounts

Hi auth0 team,

Try to see if anyone can help me out, I got this code to work with my account, which allows social login like facebook as well as Google. I tried to log in using both, but got the following error

File "/Users/chaoranxie/dev/auth0-django-web-app/01-Login/auth0login/views.py" in dashboard
  15.     auth0user = user.social_auth.get(provider="auth0")

File "/Users/chaoranxie/.virtualenvs/01-Login--MkF-23Z/lib/python3.6/site-packages/django/db/models/manager.py" in manager_method
  82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/Users/chaoranxie/.virtualenvs/01-Login--MkF-23Z/lib/python3.6/site-packages/django/db/models/query.py" in get
  407.             (self.model._meta.object_name, num)

Exception Type: MultipleObjectsReturned at /dashboard
Exception Value: get() returned more than one UserSocialAuth -- it returned 2!

Been trying to debug this myself but have no luck, my guess is that is has something to do with the first time you log in there is a session/cookies variable set but when you try to login with a second account, the system is getting both user for some reason

django-allauth and auth0

I am trying to integrate Auth0 using django-allauth as the only means for setting up users and auth/authorization of these users. I tried to follow the Django Auth0 Login tutorial you wrote using social-auth-app-django but have not been successful with the django-allauth package.

I am using the custom user model in https://github.com/pydanny/cookiecutter-django template as my staring point. I was hoping you could help me bridge the gap in my understanding on how to integrate the two.

Logging in with less clicks

Hi! I have this working well in our PoC app. We have it set up to only allow logging in with Google (whitelisted to our corporate domain only).

Is it possible to configure either Auth0 to automatically continue with the "Log in with Google" button when it's the only option the user has? Trying to reduce the number of extra (useless?) clicks the user must do.

This will improve user adoption by streamlining the process of logging in (while however infrequent that may be). I find myself asking why do I need to click this lonely button when it's the only choice.

login/auth0 not found

Hello,
I am getting the following error in chrome. Any ideas? I have just downloaded the code and run it.

The current path, login/auth0/, didn't match any of these.

Any ideas? Thanks!

Error trying to return details['user_id'] on get_user_id

Hello, I have implemented this app recently.
The problem I am having is in the get_user_id function in auth0backend.py when I try to return details['user_id'].
I have inspected the available options in details and actually there is no user_id. The options are:
{'username', 'picture', 'first_name', 'email'}

I am returning the email instead. You think there is a problema doing that. I am not quite sure when the get_user_id function it called.

Thanks a lot for the help.

a bytes-like object is required, not 'str'

While trying integrate Auth0 with my own django app following your Django Guide I couldn't get it to work and I just kept getting a bytes-like object is required, not 'str' Error. Even using your quickstart sample available in this repository. I solved to my issue editing the python-jose library in line 222 of jws.py from key = json.loads(key) to key = json.loads(key.decode('utf-8'))

I think this issue is because your samples are written for python2.7x and not python3 and the problem can be solved inside get_user_details(self, response) on views.py
check This Post from StackOverFlow for more info

Django 2 support

Error when running db migrations:

$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/base.py", line 332, in execute
    self.check()
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/base.py", line 364, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 58, in _run_checks
    issues.extend(super()._run_checks(**kwargs))
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/management/base.py", line 351, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/checks/registry.py", line 73, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/urls/resolvers.py", line 397, in check
    for pattern in self.url_patterns:
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/urls/resolvers.py", line 536, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
    return import_module(self.urlconf_name)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/webappexample/urls.py", line 21, in <module>
    url(r'^', include('auth0login.urls'))
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/auth0login/urls.py", line 7, in <module>
    url(r'^', include('django.contrib.auth.urls', namespace='auth')),
  File "/Users/daniel/Documents/Workspaces/auth0-django-web-app/01-Login/env/lib/python3.6/site-packages/django/urls/conf.py", line 39, in include
    'Specifying a namespace in include() without providing an app_name '
django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.

Works fine with 1.9, so either lock the version on the requirements file or add support for 2.0.

The specified alg value is not allowed

Hello, I am having a problem when trying to authenticate following this example.
The error occurs in this line:
payload = jwt.decode(idToken, jwks.read(), algorithms=['RS256'], audience=audience, issuer=issuer)

Actually, the jwt.py packages raises an JWTError(e): The specified alg value is not allowed

According to this issue jpadilla/pyjwt#236 it happens because: The JWT token does not have it's alg header set to "RS256" which probably means it was encoded using the wrong algorithm.

I am using the Auth0 version 2 API, specific version 6975. You think maybe adding some algorithms in the algorithms list will help? Like:
algorithms=['RS256', 'RSA', 'HMAC']

Thanks a lot for the help.
Cheers.

Error during requirements install in Django

During the instalation of the requirements of the sample project it shows an error with one of the dependencies.

errorpipinstall

After further investigation, turns out that pycrypto, a library used by python-jose (one of the requirements of the sample) is deprecated.
To solves this, the requirement must be changed.

Redirect to multiple apps

I have two auth0 applications: App 1 and App 2 - both using different connections: Connection1 and Connection2. I have two types of users: User1 and User 2. I will set it up so that User 1 for connection 1 and user 2 for connection 2. In this case, how would I set up an app that when user 1 logs in they’re redirected to App 1 and if they’re user 2 they’re redirected to App 2.

Right now I used the Django Quickstart (for App 1) to setup universal login with client ID and secret of App 1. But currently, it works only if connection 1 user logs in and if connection 2 user logs in then it says access denied. I want it to redirect to App 2 since I’m using Universal login. I have followed the Django quickstart step by step. So I don’t know what’s going on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.