Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Integration Hub use oauth2 authorization code grant to access a third party application API

sylvain_g
Tera Contributor

(release Utah)

I have configured a Connection, visible in Flow Designer, with Oauth Authorization Code, to authenticate to the third party Application (First I have created a Configuration Template in All/Integration Hub/Connection and Credential/Configuration Templates, from the existing template "Oauth Authorization Code Demo Configuration", then I have created a new Connection in  All/Integration Hub/Connection and Credential/Connection and Credentials alias, set with the my new configuration template.

 

In flow designer I have configured my connection with my parameters : ex. authorization url, token url.

If I click on the link "Get Oauth Token" , a popup appears displaying my application authentication page : I authenticate with a user , and it's work, the token is stored (visible in "Manage tokens")

 

Then I have created an action that request my third party application

Then I have created a "remote table" in ServiceNow that call that action to populate dynamically my table

When I request the table with <table_name>.list , it is working !

 

But it always uses the same access_token registered the first time I configure my Connection.

Would it be possible to use an access_token per user ? If I request the table from another user, I would like that a popup appears requestiong the user to authenticate to the third party IDP and that serviceNow uses the access_token of the user ? Then , till the refresh_token of the user is valid, the user will not be asked to authenticate again, and servicenow will use the user token.

 

Regards,

 

Sylvain Guyot

1 REPLY 1

maheshbingi
ServiceNow Employee
ServiceNow Employee

You can use personal authentication, which is supported for OAuth Authorization Code Flow. To configure personal authentication with OAuth:

  • Go to your oauth_2_0_credentials record
  • Change the integration_type from System to Personal

Now, for every user, there will be a separate access token in Manage Tokens.

 

You can also refer to the following documents for more details on Personal Authentication: