基本身份验证处理程序正在使用HTTP协议,但与WSO2 EI中的HTTP无关

发布于 2025-01-31 09:17:14 字数 1563 浏览 3 评论 0原文

我在 https://docs.wso2.com/m/mobile.action#page/33136403/header/securingapis-basicauthusingabasicauthhandler 。 按照相同的步骤遵循我可以使用http协议IE测试IE http:// localhost:8290/api/and basic auth username:password用户: 现在,我想在2件事下进行2件事,

  1. 使HTTPS适合相同 如果我在上面尝试一样尝试,并且url'https:// localhost:8243/api'什么也没发生,
  2. 我想更改用户名:password:http

for http和https之类的其他内容,我的api我的api看起来如下:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <!-- <handler class="test1.BasicAuthHandler"/> -->
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>


<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/" protocol="https">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>

I am following the example 'Using a Basic Auth handler' at https://docs.wso2.com/m/mobile.action#page/33136403/header/SecuringAPIs-BasicAuthUsingaBasicAuthhandler.
With the same steps followed I am able to test with http protocol i.e http://localhost:8290/api/ and basic auth username:password admin:admin
Now I want to do below 2 things

  1. enable https for the same
    if I try as same above and url 'https://localhost:8243/api' nothing happens
  2. I want to change the username:password to something else like newuser:password1

For http and https my api looks like below:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <!-- <handler class="test1.BasicAuthHandler"/> -->
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>


<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/" protocol="https">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉酒的小男人 2025-02-07 09:17:14

您可以添加WSO2 EI版本和Java处理程序代码吗?
我带有HTTPS的基本授课作品。如果要更改用户名和密码,则必须更改默认Java代码,或者可以连接到Handler的本地USERSTORE或AD。

can you add your WSO2 EI version and your java handler code?
My basic auth with https works. If you want change username and password you must change your default java code or you can connect to local UserStore or AD from handler.

海的爱人是光 2025-02-07 09:17:14

您确定使用正确的端口吗? 8290的HTTP端口表明10。在这种情况下,HTTPS端口为8253而不是8243。这可能会导致“什么都没发生”。

Are you sure you are using the correct port? The HTTP port of 8290 suggests an offset of 10. In that case the HTTPS port would be 8253 instead of 8243. That might cause that 'nothing happens'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文