How can i use "get oauth token" from other UI in servicenow like form or UI page.?

abuthahir
Tera Expert

Hi everyone, i have created a OAuth registry and everything is working perfectly. When i hit "Get OAuth Token" my oauth flow is successfull and i am able to get the new window to login to my google account. I need the same related link to work in other UI like form or UI page to get access token and pop up window to login the google account and then perform a rest message. Please suggest if anyone has done similar functionlaity.? pradeepksharma kalai ctomasi

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Take a look at the OOB UI action for Get OAuth Token. While it's not directly transferrable to a UI page (because UI pages don't have a g_form object available), it should give you a head start on how to implement it.



Change YOURINSTANCE to your instance name in the URL below.



https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=a9ec9e528f20020026935f2a3...


View solution in original post

4 REPLIES 4

Chuck Tomasi
Tera Patron

Take a look at the OOB UI action for Get OAuth Token. While it's not directly transferrable to a UI page (because UI pages don't have a g_form object available), it should give you a head start on how to implement it.



Change YOURINSTANCE to your instance name in the URL below.



https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=a9ec9e528f20020026935f2a3...


Hi Chuck, Thank you so much. Even am building the same and modifying the code as per my requirement to use it in different form. WIll update once it is working.


Great idea, i managed to customize the OOB UI Action code and its working perfect. Will get back if i am stuck anywhere else while working this google API.


I'm glad you got your question answered. Thank you for participating in the community.