OAuth add custom script parameter not working

logancornelius
Tera Contributor

I've spent several days trying to get oauth to work and keep coming up short. The main issue is that the oauth provider sends in a state value and the state value does not meet the requirements needed by the system I'm trying to connect to. I have tried every which method I can find online to update or add a auth parameter and nothing is working.

Below are all different ways and things I've tested some just to see if I can affect the paramters at all, and none of them are working. What am I missing? I've been dancing around the answer for days now and need some insight of what I'm not seeing.

 

 

interceptRequestParameters: function(requestParamMap) {
		// Add/Modify request parameters if needed
		requestParamMap.put('resource','https://xxxx.core.yyy.net/');
		this.preprocessAccessToken(requestParamMap);
	},

var OAuthNSAuthParams2 = Class.create();
OAuthNSAuthParams2.prototype = Object.extendsObject(OAuthUtil, {

preprocessAuthCode: function(requestParamMap) {
// this.oauthContext.setAuthorizationEndpoint("auth_endpoint");
// this.oauthContext.addQueryParameter("name","jackson");
// this.oauthContext.addHeader("Content-Type","application/json");
// // this.oauthContext.addHeader("client_id","{client_id}");
// this.oauthContext.addHeader("state","{state}");
// var profGr = this.oauthContext.getOAuthProfile();
// gs.info(profGr.getValue('name'));
},
 
preprocessAccessToken: function(requestParamMap) {
// this.oauthContext.addHeader("Content-Type","application/json");
// this.oauthContext.addQueryParameter("name","jackson");
// gs.info(this.oauthContext.getQueryParameter("name"));
// gs.info(this.oauthContext.getHeader("Content-Type"));
// this.oauthContext.setTokenEndpoint("{endpoint}");
// var profGr = this.oauthContext.getOAuthProfile();
// gs.info(profGr.getValue('grant_type'));
},
 
type: 'OAuthNSAuthParams2'
});
 

 

0 REPLIES 0