davecoleman
4 years agoContributor
constant com.eviware.soapui.impl.rest.actions.oauth.OAuth2Parameters.PKCEChallengeMethod.Not defined
hi all,
I can manually request a token in my Project. if I however use "Inherit from Parent" where I have the Event SubmitListener declared below, I get the following error when a request is sent:
Wed Mar 10 14:47:52 GMT 2021: DEBUG: No enum constant com.eviware.soapui.impl.rest.actions.oauth.OAuth2Parameters.PKCEChallengeMethod.Not defined
The script is below. Any ideas on why this occurs?
// Import the required classes
import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade;
import com.eviware.soapui.support.editor.inspectors.auth.TokenType;
import com.eviware.soapui.model.support.ModelSupport;
// Set up variables
def project = ModelSupport.getModelItemProject(context.getModelItem());
def authProfile = project.getAuthRepository().getEntry("UAT1");
def oldToken = authProfile.getAccessToken();
def tokenType = TokenType.ACCESS;
// Create a facade object
def oAuthFacade = new OltuOAuth2ClientFacade(tokenType);
// Request an access token in headless mode
oAuthFacade.requestAccessToken(authProfile, true, true);
// Wait until the access token gets updated
//while(oldToken == authProfile.getAccessToken()) {}
//The sleep method can be used instead of a while loop
//sleep(3000);
for(int i = 0; i<=3000; i++){
if(oldToken != authProfile.getAccessToken()){
break
}
sleep(1)
}
asd
Hi davecoleman , judging by Rao's reply, the error is not connected with the script. Have you tried looking for other possible reasons?
Also, I will recommend support for deeper investigation.