How to validate organization admin user using management api in apigee edge trial version?

0 4 368

Hi,

I am trying to implement a simple login functionality where an apigee admin user will enter login credentials and they should be validated using apigee management api.

I am making a POST call to: https://api.usergrid.com/management/token with the following request body:

{"grant_type":"password","username":"suman.maity@cognizant.com","password":"{my password}"}

I am also passing a Basic authentication header computed using my email id (suman.maity@cognizant.com) and password (same as my password).

On success the API should return an access token. Instead I am getting the below error:

{
  "error": "auth_invalid_credentials",
  "timestamp": 1482142615423,
  "duration": 0,
  "error_description": "Unable to authenticate due to invalid client credentials",
  "exception": "org.apache.usergrid.rest.exceptions.SecurityException"
}

Am I missing here something? Please help.

Note: I am using apigee edge free (trial) cloud account.

Comments
ozanseymen
Staff

I have a feeling that you are confusing BaaS (usergrid) and Edge products. The token endpoint you are referring to belongs to API BaaS product but you are saying you are using apigee management api (which is to manage Edge product).

Not applicable

Hi Ozan. Thanks for replying! I agree that management API is to manage Edge product.

Now, if you could spot any issue with the way I am invoking the API to generate a token that would be great.

Between, I am able to access the BAAS data store using my Apigee edge credentials and able to perfrom CRUD operations on collection entities. So this means I have access to the BAAS data store.

Thanks,

Suman

ozanseymen
Staff

Edge management api supports basic authentication and OAuth, see http://docs.apigee.com/api-services/content/using-oauth2-security-apigee-edge-management-api

API BaaS uses oauth (various forms): http://docs.apigee.com/app-services/content/authenticating-users-and-application-clients

You still haven't mentioned which product you are trying to login to. If you are trying to connect to Baas, try without the Authorization header. See above doc still though.

Not applicable

Hi Ozan,

Thanks! It worked without the Authorization header!! Thanks a lot!

Version history
Last update:
‎12-19-2016 02:33 AM
Updated by: