I want to login auth0 using Usename/Password for getting AccessToken.
Solution: https://stackoverflow.com/questions/69419470/auth0-error-authorization-server-not-configured-with-default-connection
Methods
1. Make sample user
- Navigate to your dashboard - manage.auth0.com/dashboard
- On the left menu, click on
User Management
→ Users
- Click on
+ Create User
username: e2e-test@example.com
password: PassW0rd
2. Get AccessToken (Failed)
3. Add Grant
Open https://auth0.com/docs/api/management/v2/clients/patch-clients-by-id .
Set Authorized Token.
Update Grant Type
path:
body
url: https://<tenant name>.auth0.com/api/v2
A Curl command with the above parameters would look like this.
Ref: https://community.auth0.com/t/error-grant-type-password-not-allowed-for-the-client-for-resource-owner-password-flow/6951/2
4. Get AccessToken (Failed)
ReTry, but
5. Set Default Directory
- Navigate to your dashboard - manage.auth0.com/dashboard
- On the left menu, click on Setting
- Scroll down to “API Authorization Settings”
- Enter Username-Password-Authentication in the “Default Directory” input
- Hit save - It typically takes about 30secs for changes to take effect
Ref: https://stackoverflow.com/questions/69419470/auth0-error-authorization-server-not-configured-with-default-connection
6. Test
7. Next
Write Go Test Code
Note
References
Ref: https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391
Ref: https://community.auth0.com/t/is-there-an-easy-way-to-get-a-user-access-token-for-testing/73170