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

Outdated Readme.md #482

Closed
aviel08 opened this issue Mar 20, 2023 · 4 comments · Fixed by #484
Closed

Outdated Readme.md #482

aviel08 opened this issue Mar 20, 2023 · 4 comments · Fixed by #484
Labels
bug This points to a verified bug in the code

Comments

@aviel08
Copy link

aviel08 commented Mar 20, 2023

Describe the problem

Documentation on Readme.md is outdated.

Reproduction

from auth0.authentication import Database

database = Database('my-domain.us.auth0.com', 'my-client-id')

database.signup(email='user@domain.com', password='secr3t', connection='Username-Password-Authentication')

The above code produces:
ModuleNotFoundError: No module named 'auth0.authentication'

I think it should be:

from auth0.v3.authentication import Database

database = Database('my-domain.us.auth0.com')

database.signup(email='user@domain.com', password='secr3t', connection='Username-Password-Authentication', client_id ='client_id')

Same for the rest of the examples. Login requires token.login to pass scope and audience.

I'm using Python 3.9 and the latest pip install auth0-python

@marcusmotill
Copy link

v3 folder was removed in the 4.0.0 release docs seem correct for those using v4

@aviel08
Copy link
Author

aviel08 commented Mar 21, 2023

That is correct, I must have installed V3 before and pip install auth0-python will not upgrade to the latest version unless specified, my bad, but If I run the example for login:

from auth0.authentication import GetToken

token = GetToken('my-domain.us.auth0.com', 'my-client-id', client_secret='my-client-secret')

token.login(username='user@domain.com', password='secr3t', realm='Username-Password-Authentication')

I get:
TypeError: login() missing 2 required positional arguments: 'scope' and 'audience' Which is not a problem, I can pass those 2 arguments, I'm just wondering what's wrong.
I have auth0_python-4.1.0-py2.py3-none-any.whl

@adamjmcgrath
Copy link
Contributor

Hi @aviel08 - thanks for raising this

The signature of GetToken#login hasn't changed between v3 and v4 and that doc hasn't changed. So I think this is an old issue with the GetToken API. Strictly speaking audience, scope and realm should be optional https://auth0.com/docs/api/authentication#resource-owner-password

Will raise a PR to change those positional arguments to keyword arguments, which should fix that example.

@adamjmcgrath adamjmcgrath added the bug This points to a verified bug in the code label Mar 27, 2023
@githubisagit
Copy link

Have run into same exact problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants