How to configure Outbound Rest Message with oAuth 2.0 - Resource Owner Password Credentials

Meloper
Kilo Sage

Hi,

i have Username, Password, ClientID and Client Secret to get a Token, with that Token i need to call a second Endpoint to get the Values.
Instance is on Yokohama Patch 2.

If i create the OAUTH2 Provider Record and the matching Credentials Rercord. Im able to get the Token over the Midsever if write Username and Password in that Pop Up Window.

So after this i created a Rest Message with a GET methode and the Endpoints which holds the Datas that i need.

But i cant connect.
I tried with a manual header and copy and paste the Values (token)
Also in a Script i can click manual on "get Oauth token"
What are the Steps need to be done to have a REST Message, connected to that OAUTH2 Profil which gets the Token and calls the Rest Message automatically? 

7 REPLIES 7

Hi, i dont know why i need to script and store something in Properties.
I created a Oauth_entity record, get the Oauth Profil, created the Credentials Record and created a Rest message which is linked to that Profil.

Now i want to use this Rest message.
I guess it should be clear that i can not klick on get Oauth2 token every time before i send the Message.
also to store the password in a property is not best bcratice.
but thanks, i will try to find a way and follow the Process for that password grant type 🙂

@Meloper 

you don't need to manually click everytime.

use script to get the access token and then use that in your 2nd API call

Links to use that script is already shared

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Meloper 

Thank you for marking my response as helpful.

I believe I have answered your question and you can take it from here.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader