【问题标题】:soapUI - Oauth2 and Basic Authentication to retrieve tokensoapUI - Oauth2 和基本身份验证以检索令牌
【发布时间】:2018-04-11 00:07:37
【问题描述】:

我需要使用 oauth2 开发 SoapUi 测试,授权 API 需要基本身份验证。

我尝试使用 [username]:[password]@url 方法,但密码包含一个特殊字符 @,它被更改为 %40,我也更改了 Enconding 但没有运气。

【问题讨论】:

    标签: oauth-2.0 soapui basic-authentication


    【解决方案1】:

    我在 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);
            }
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2020-03-03
      • 1970-01-01
      • 2021-07-29
      • 2011-03-18
      • 2021-01-25
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      • 2014-12-17
      相关资源
      最近更新 更多