How to make a username password request with auth0 custom api, getting error “unsupported grant type: password” error

前端 未结 3 2062
小蘑菇
小蘑菇 2021-01-04 05:36

I tried using the auth0 postman template to make an authentication request using username and password and I\'m getting an unsupported grant type: password error

相关标签:
3条回答
  • 2021-01-04 06:18
    1. Log into the Auth0 dashboard
    2. Go to account settings (top right under your username)
    3. On the general tab scroll down to the API Authorization Settings section
    4. Default Audience would be your API identifier (if you have an API)
    5. Default Directory would be your connection such as database connection name

    In your POST to oauth/token do not include audience (if you specified the default above).

    Gotta love how Auth0 makes authentication easy and painfully hard at the same time.

    Refer below screenshot as a reference.

    0 讨论(0)
  • 2021-01-04 06:23

    Go to Default App > Settings >

    In the bottom of settings, Click {Show Advanced Settings}

    Select Grant Types Tab

    Check the password which is unchecked by default

    Post request to *//oauth/token and it works

    0 讨论(0)
  • 2021-01-04 06:26

    These are the exact steps I have taken in order to resolve this exact issue

    Login with browser on desktop At top right of UI, click click username, Settings

    Scroll down to API Authorization Settings

    Enter valid values in BOTH Default Audience, and Default Directory.

    For example, for me I already had been using the Lock screen, and had already setup a Default Audience which I was setting in my client application and everything was working.

    I also had already setup a Connections > Database, with the name of Username-Password-Authentication.

    Here is a screenshot of it working after doing the above, using the postman collection , which at the time of writing, is contained here

    https://app.getpostman.com/run-collection/2a9bc47495ab00cda178

    which is referenced here

    https://auth0.com/docs/api/authentication#code-samples

    0 讨论(0)
提交回复
热议问题