1.3、Basic Authentication
支持基于用户名和密码的基本认证,通常用于简单的身份验证场景。
1.3.1、环境准备
1.3.1.1、创建一个服务,basic-auth-service
curl -i -s -X POST http://localhost:8001/services \
--data name=basic-auth-service \
--data url='http://localhost:8080'
http://localhost:8080 端口是运行一个Go的服务,请求/hello将返回对应的数据。
将会返回数据:
Hello, kong,I'm runing at 8080!
1.3.1.2、创建对应的路由,basic-auth-route
curl -i -X POST http://localhost:8001/services/basic-auth-service/rout