API authentication failed for microsoft account

Having issues with the Authenticate method using microsoft credentials. I have tried the post method from swagger and postman but with no luck.

Below is the response I get.
{
“message”: “Invalid credentials, failed to login.”,
“errorCode”: 1000,
“resourceIds”: null
}

Below is my request.
{
“tenancyName”: “Default”,
“usernameOrEmailAddress”: [MicrosoftAccount],
“password”:“Password”
}

I login to the orchestrator using single sign on with the microsoft account and I dont know if that is what is causing issues with the API.

Any help here would be appreciated. I have gone through all the posts but none of them seem to fix this particular issue

2 Likes

hi @Ayyappan10

try to login to orchestrator using the credentials which your passing in the request,if that is working then the request also should work.

but i am not sure about Microsoft account credentials.
instead can you try passing original credentials(email or ID) which you use to login to orchestrator(not windows login , manual login credentials, something like below).

image
{
“tenancyName”: “Default”,
“usernameOrEmailAddress”: userID,
“password”:“passwrod”
}

Regards
AJay

Hi Ajay, I did try and login with a non microsoft account. I used my gmail and password to logon to orchestrator manually and it works fine. However from the API i still get the invalid creds error.

@Ayyappan10

try with http Request by passing parameters

Hi, I tried and I get the same response - invalid creds.

Can you please let me know what is the endpoint url you are using.

I am using the below:
https://platform.uipath.com/a*********g**m/******Default/api/Account/Authenticate/

and the tenancyName I am using is “Default”

@Ayyappan10

The 2019-09 version of the Cloud Orchestrator changed REST API Authentication. It no longer uses Basic Authentication.

From the post you made ^^^^^ 2 hours ago, I think you are trying to use Cloud Orchestrator. If you have an On-Premises Installation of Orchestrator, Basic Authentication still works.

There are a couple of resources to help you with the Cloud Orchestrator REST API Authentication:

  1. Official Documentation found at: About OData and References . See the section at the bottom of the ToC, “Consuming Cloud API”

  2. HareeshMR has a blog post on forum.uipath.com: Steps for authenticating and using Orchestrator cloud API

  3. I have written the Definitive Guide to Cloud Orchestrator REST API Authentication which you can find here: The Definitive Guide to UiPath Cloud Orchestrator 2019.9 REST API Authentication. – Deale Tech

Also, the credentials you use for the platform.uipath.com are the credentials you use to login interactively.

Hope this helps.

– Michael.

Thank you so much @mjdeale. This has got me started however at the final step of getting the access token I have the same issue with Microsoft account. To login to the cloud orchestrator I use the single sign on using Microsoft account and it does not ask me a password. I am not sure if that is what is causing issues and I get the below response while I authenticate.
{
“message”: “An error has occurred.”,
“errorCode”: 0,
“resourceIds”: null
}

May be the browser has the cookies which are related to microsoft already. So try to log out of the microsoft and then login.

If you know the password, then no need of the above step as well. Can you let me know if you are providing the password? And the error is Not related to password . I hope you are missing some inputs. Please check that

I cannot use my email and password to logonto orchestrator. It gives me invalid email address or password error. The only way I can login is using the “Continue with Microsoft” option.

Please find below what I am doing on Postman.


The bearer token is the access token.

Please find below my request body

This is the response I get:
image

You have to use that username and password to login to microsoft account and orchestrator as well @Ayyappan10, Just clear the cookies for that site and try to give username and password for login to the orchestrator instead of Microsoft account. If you try after clearing the cookies, then you need to login to Microsoft as well.

And the tenant name should be the account logical name which you got in one of the steps above.It is not the default one.

Please try above and let me know the status of the request.

Can you post the status of the request above?

Hi Hareesh I dont think it works that way, please correct me if I am wrong.
Please find below the steps. I tried this on a new browser and also cleared cookies.

  1. Open the UI Path Account Login page using

  2. I cannot use the Email and password option as it gives invalid email/pwd error. I think this is because I am registered with SSO on microsoft.

  3. I click on the continue with microsoft option and get the below.
    image
    It picks up the creds automatically because I am connected to Windows.

And regards to the tenant name, yes I first tried with the logical name it didnt work and that is why I also tried with the default name.

I also tried to connect using my personal account which accepts username and pwd and I get the same error at the step of authenticating. So I guess it is something else that is giving the below error.
{
“message”: “An error has occurred.”,
“errorCode”: 0,
“resourceIds”: null
}

Highly appreciate your time here and happy to test any other thing that you would like me to.

1 Like

Yeah whatever you mentioned in the third point, use that same mail id and the password to login to that office 365 account while authenticating the API also @Ayyappan10