Auth0 Home Blog Docs

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

auth0
login
azure-ad

#1

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": "http://auth0.com/oauth/grant-type/password-realm",
    "audience": audience,
}
headers = {
    'Content-type': 'application/json'
}
requests.post(url=url, json=json_request_parms, headers=headers)

which return in the mentioned error.

Any help would be grateful.


#2

@jmangelo Can you help me out here.


#3

I am having the same problem. Can someone help?


#4

have you found a solution for this yet?