Forum Discussion

davecoleman's avatar
davecoleman
Contributor
4 years ago

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.

    • nmrao's avatar
      nmrao
      Champion Level 3
      Based the script, there is no such line in the script which can lead to mentioned error.
      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        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.

  • areddappa's avatar
    areddappa
    Regular Visitor

    Hello, I am getting the same error, but token is getting updated, how did you solve the issue?

    • Tue Apr 27 13:35:29 AEST 2021: DEBUG: No enum constant com.eviware.soapui.impl.rest.actions.oauth.OAuth2Parameters.PKCEChallengeMethod.Not defined

    Is the error related to the new field added in the dialog box. Enable PKCE?