Badr Eddine Laaroussi
Badr Eddine Laaroussi

Reputation: 21

soapUI - Oauth2 and Basic Authentication to retrieve token

I need to develop a SoapUi test using to oauth2, the authorization API requires Basic Authentication.

I tried to use the [username]:[password]@url approch, but the password contains a special character @ that gets changed to %40, I also changed the Enconding but no luck.

Upvotes: 0

Views: 562

Answers (1)

Badr Eddine Laaroussi
Badr Eddine Laaroussi

Reputation: 21

I added the header in the class EnabledWebViewBasedBrowserComponent

public void navigate(final String url, String errorPage) {
    if (SoapUI.isBrowserDisabled()) {
        return;
    }
    setErrorPage(errorPage);

    this.url = url;

    Platform.runLater(new Runnable() {
        public void run() {
            getWebEngine().setUserAgent("\nAuthorization: Basic bWNb25lhbGRzlk1jRDuGxklWg==");
            getWebEngine().load(url);
        }
    });
}

Upvotes: 1

Related Questions