Method failed: (xxx) with code: 401 - Invalid username/password combo (Microsoft Partner Api)

User156087
Tera Contributor

I'm configuring ServiceNow with the microsoft partner api zo I can manage the Microsoft CSP portal.

I set up a sandbox environment and configured the Api in the Application Registry and OAUTH Entity Profile with Grant Type Client Credentials.

Now I'm trying to configure a rest message.

find_real_file.png

When I ask for a OAUTH Token I receive it and it is authorised.

Now I configure the HTTP Method like this:

find_real_file.png

find_real_file.png

When I try to do a test run I receive an error message:

Method failed: (/v1/customers) with code: 401 - Invalid username/password combo

I've tried to change the authentication type to No Authorisation but the error is the same.

I've tried to find the answer in the Partner Center REST API reference | Microsoft Docs   but cannot find the anser.

Can anyone help with a solution?

4 REPLIES 4

Sashi K1
Kilo Guru

Since you are testing using console (not script yet), are you passing all required HTTP Query parameters required? If yes, I would check what util you were using on uAuth profile. For 'Clicent Credentials' grant type use 'OAuthUtil' for oAuth API Script on the oAuth profile. Also check com.snc.platform.security.oauth.is.active to be true.


I've checked the com.snc.platform.security.oauth.is.active property and this is True.



About the HTTP Query parameters, I think I must the followin in the header   (see Get a list of customers | Microsoft Docs)


Authorization: Bearer <token>



The token value should be from the authentication type, but how can I add this in the HTTP Request


find_real_file.png





Did you ever get this to work? I am facing the same issue as this screenshot's question.

Inactive_Us1145
Kilo Explorer

Hello,

Did you get this work? I'm facing same issue.

 

Thanks