How to share access token with multiple users

Subramani3
Giga Contributor

Hi All,

In a scoped application, I am connecting with Third Party APIs using access token. The access tokens are generated by consuming the servicenow oauth2.0 methods. 

I would like to maintain one access token and one refresh token in the environment which can be used by any user. Similarly when the access token and refresh token has expired, new tokens can be generated by any user.

Currently when I am generating an access token, it can be consumed only by that specific user and admin role. However, it cannot be consumed by any other user.

Any information will be really helpful. Thanks in Advance.

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi

unfortunately it is not really whether the connection is inbound or outbound.

But in any case, you always communicate with externals via REST message (outbound) or Scripted REST APIs (inbound). If you want to enable more than one user to use that communication relation, you have to implement an abstraction layer (for example a Script Include) which handles the communication and can be used by any user.

And to answer your question: No it is not possible to share refresh tokens. If that were possible, the whole OAuth concept would be pointless.

Maik

Subramani3
Giga Contributor

Hi Maik,

 

Thank you so much for the response. I have script include to call the Rest Message. The reason I was asking for sharing the tokens is that the credentials (username and password) along with client details used to connect to the third party provider is going to be the same for all users.

Also, if I generate the tokens using a scheduler...will the other users be able to access it as the tokens will be created by "system"

Thanks,

Subramani

Hi @Subramani 

yes, this is the nature of system-to-system communication - for example for requesting data from external providers. 

A completely different scenario, you would have if the external provider requires that each request has to be done with a dedicated user account. Implementation of such a scenario is more complex and cannot be answered in a simple Community question.

Maik

Thank you @Maik