Auth0 Home Blog Docs

Oauth/token responds with error": "invalid_grant", "error_description": "Invalid username or password" for Azure AD



I’m trying to evaluate a possible solution using auth0, most likely to be converted in business for auth0.

To achieve a common auth from AD and a user database, for which the database seems connection seems to be working fine, however when I try to use Azure AD auth, I get a response as below, though I’m using realm to specify connection name. Mu concern is that the sample connection using ‘try’ from connection works just fine, but not from API calls.

This is what I could get

    "error": "invalid_grant",
    "error_description": "Invalid username or password"

Here’s a sample code which I’m using.

json_request_parms = {
    "username": username,
    "password": password,
    "scope": scope,
    "client_id": client_id,
    "client_secret": client_secret,
    "realm": realm,
    "grant_type": "",
    "audience": audience,
headers = {
    'Content-type': 'application/json'
}, json=json_request_parms, headers=headers)

which return in the mentioned error.

Any help would be grateful.


@jmangelo Can you help me out here.