Add additional request parameter during get token for external OIDC Identy Provider

einvaldserigsta
Kilo Sage

We are using an external OIDC Identity Provider for users to log in. To be able to get the token successfully (using the token URL) from the provider, we need to enforce an additional parameter to the /token request. 

 

For Oauth, there is a specific recipe on how to achieve this: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0792354 - But I can not find a way to do the same for OIDC. 

 

Has anyone found a way to do this, or have any suggestions on where to add this?

1 ACCEPTED SOLUTION

einvaldserigsta
Kilo Sage

I was able to solve this almost like described in https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0792354.

I made a OAuthCustomUtil (extending OAuthUtil), and added this script include in the Oauth API Script field in the OIDC entity record.

preprocessAccessToken: function(requestParamMap) {
requestParamMap.put('some_param',"some value");
},



View solution in original post

2 REPLIES 2

Bert_c1
Kilo Patron

https://support.servicenow.com/now?id=ns_search&q=OIDC&s=true&pp=kb_article_view

 

May be of help. Also using "servicenow OIDC token" in Google search.

einvaldserigsta
Kilo Sage

I was able to solve this almost like described in https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0792354.

I made a OAuthCustomUtil (extending OAuthUtil), and added this script include in the Oauth API Script field in the OIDC entity record.

preprocessAccessToken: function(requestParamMap) {
requestParamMap.put('some_param',"some value");
},