I found this issue while creating a condition in an Oauth proxy. I needed to set the token to expire based on scope. I created a javascript policy and built the condition
var ExpirationTimeScope = context.getVariable("request.formparam.scope"); //captures the name of the scope
var ExpirationTimeSet = 3600000; ///default scope setting
if (ExpirationTimeScope === 'mobile') {
ExpirationTimeSet = -1; //token never expires
}
context.setVariable('flow.expirationTime', ExpirationTimeSet
);
I made reference to this code within the Oauth Policy
<Operation>GenerateAccessToken</Operation>
<Scope>request.formparam.scope</Scope>
<ExpiresIn ref="flow.expirationTime">3600000</ExpiresIn>
The code would complete but the scope wouldn’t pick up. Can someone assist? I started receiving this message within the trace
“java.lang.Integer cannot be cast to java.lang.String”