HTTP request Wizard to get token using OAuth2.0

I am trying to generate access token using grant type as “authorization code” to use Dynamic 365 F & O api, when I try to generate access token, the response from the HTTP request is sign in option as a html response.

Has anyone achieved using grant type as authorization code to connect either o365 or d365?

The same is achieved using postman but I am having trouble using HTTP wizard to generate an OAuth2.0 token.
The parameters in Postman has callback URL what could that be in Uipath?

Hi @Mritika,

By watching the video, you can see how to move the actions you have done in the postman to UiPath. Please test and share if you get any errors.

Regards,
MY

I have already tried to configure the same parameters and the response is html “sign in option”.
The call back URL in postman is defined, the sign in options pop up appears to choose an user account, I can’t use that in HTTP request wizard. Is there any uipath callback url for authentication?

Hey @Mritika

Could you please show us the screenshot of configuration made on Postman and the HTTP activity?

Thanks
#nK

Basically you need an URL where OAuth will send the token. A few ways to take that approach.

  • I don’t know if a connector exists for Dynamics 365, look at the marketplace, if exists, use this option
  • Setup the redirect to localhost, most likely you will need to create a self signed SSL certificate (openssl) (on the bot machine)
  • Create a nodejs web server (on the bot machine)
  • Create a UiPath App and use the generated URL, your bot will need to be able to authenticate to orchestrator, you may require additional handling to parse the token (in orchestrator)


image
The only thing I am missing is the call back URL, which I am not sure.
Once I click the generate token in postman, I get the pop up.

1 Like

Actually, there’s a Dynamics 365 connector.

So the above mentioned url in the popup you get that’s the one.

Copy it until ?

The connector is for Dynamic 365 CRM and I am looking for ERP (Finance and operations).
but Thanks for the find!

The URL had redirect URI encoded in it,
1https://login.microsoftonline.com/common/oauth2/authorize?resource={}&response_type=code&client_id={}&scope=User.read&redirect_uri=https%3a%2f%2foauth.pstmn.io%2fv1%2fbrowser-callback&sso_nonce={}&client-request-id={}

https://login.microsoftonline.com/common/oauth2/authorize