Request an Access Token using the Resource Owner Flow

hi,
I’m using a trial Account (NA account) and i am trying to authenticate to the AirVantage M2M Cloud using my credentials (username , password) but i can’t authenticate. it’s a bad credential error although i’m using the right user and password.
why can’t i authenticate with my credentials

thank you in advance

Hi,

It should work. We used this flow many times.
Can you give us the sequence of API calls you’re using. It will help us to identify the issue.

David

hi,
thank you for your reply, I’m using the example found on GitHub wich will access to AirVantage API from java.
you can find the exemple by going to this url : https://github.com/AirVantage/airvantage-api-java
thank you again .

When I send the following request:

GET https://na.airvantage.net/api/oauth/token?grant_type=password&username={login}&password={password}&client_id=0fbf4ade773f4c91aacacfecd6870122&client_secret=0374ae58918b47aeaf6c7b060fd595dd

I receive the following response:

{
access_token: "6eb92088-c025-4c85-a4f7-90bf8bc2461g"
token_type: "bearer"
refresh_token: "7519c788-7ad4-4c2d-af25-ae40e40881ea"
expires_in: 86399
}

So it’s working

Can you try this request with your credentials? with you API Client ID and Secret?

when i send the request i receive this request, i’m sure that i’m using the right username and password :frowning:

<oauth>
<error_description>Bad credentials</error_description>
<error>invalid_grant</error>
</oauth>

Is there any special characters in your login or password? If yes, it should be url encoded http://meyerweb.com/eric/tools/dencoder/

thank you very much dsciamma :slight_smile:

Is it working now?

yes yes it’s working finally, thanks to you , i have a special characters in my password :wink: