Repository: auth0/auth0-python

Issue:
Outdated Readme.md
<!--
**Please do not report security vulnerabilities here**. The Responsible Disclosure Program (https://auth0.com/whitehat) details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community (https://community.auth0.com/) or Auth0 Support (https://support.auth0.com/). Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct (https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
-->

### 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

Comments:

Patch:
diff --git a/auth0/authentication/get_token.py b/auth0/authentication/get_token.py
index bb697a2..4986e55 100644
--- a/auth0/authentication/get_token.py
+++ b/auth0/authentication/get_token.py
@@ -118,9 +118,9 @@ class GetToken(AuthenticationBase):
         self,
         username,
         password,
-        scope,
-        realm,
-        audience,
+        scope=None,
+        realm=None,
+        audience=None,
         grant_type="http://auth0.com/oauth/grant-type/password-realm",
     ):
         """Calls /oauth/token endpoint with password-realm grant type
@@ -134,18 +134,18 @@ class GetToken(AuthenticationBase):
         this information.
 
         Args:
-            audience (str): The unique identifier of the target API you want to access.
-
             username (str): Resource owner's identifier
 
             password (str): resource owner's Secret
 
-            scope(str): String value of the different scopes the client is asking for.
+            scope(str, optional): String value of the different scopes the client is asking for.
             Multiple scopes are separated with whitespace.
 
-            realm (str): String value of the realm the user belongs.
+            realm (str, optional): String value of the realm the user belongs.
             Set this if you want to add realm support at this grant.
 
+            audience (str, optional): The unique identifier of the target API you want to access.
+
             grant_type (str, optional): Denotes the flow you're using. For password realm
             use http://auth0.com/oauth/grant-type/password-realm
 


Test patch:
diff --git a/auth0/test/authentication/test_get_token.py b/auth0/test/authentication/test_get_token.py
index 7dd9f49..f2c0b34 100644
--- a/auth0/test/authentication/test_get_token.py
+++ b/auth0/test/authentication/test_get_token.py
@@ -163,6 +163,32 @@ class TestGetToken(unittest.TestCase):
             },
         )
 
+    @mock.patch("auth0.rest.RestClient.post")
+    def test_login_simple(self, mock_post):
+        g = GetToken("my.domain.com", "cid", client_secret="clsec")
+
+        g.login(
+            username="usrnm",
+            password="pswd",
+        )
+
+        args, kwargs = mock_post.call_args
+
+        self.assertEqual(args[0], "https://my.domain.com/oauth/token")
+        self.assertEqual(
+            kwargs["data"],
+            {
+                "client_id": "cid",
+                "client_secret": "clsec",
+                "username": "usrnm",
+                "password": "pswd",
+                "realm": None,
+                "scope": None,
+                "audience": None,
+                "grant_type": "http://auth0.com/oauth/grant-type/password-realm",
+            },
+        )
+
     @mock.patch("auth0.rest.RestClient.post")
     def test_refresh_token(self, mock_post):
         g = GetToken("my.domain.com", "cid", client_secret="clsec")