领取资料,咨询答疑,请➕wei: June__Go
上一小节我们学习了postman配置环境变量的方法,本小节我们讲解一下postman Authorization授权的几种方法。
鉴权的定义
鉴权就是验证请求者是否有权从服务器访问所需要的数据。发送请求时,通常必须包含相应的检验参数以确保请求具有访问权限并返回所需数据。
简单理解,鉴权就像门禁,你要想进入小区,就得通过门禁卡来验证身份,这就是鉴权。
官网介绍如下
APIs use authorization to ensure that client requests access data securely.
This can involve authenticating the sender of a request and verifying that they have permission to access or manipulate the relevant data.
If you're building an API, you can choose from a variety of auth models.
If you're integrating a third-party API, the required authorization will be specified by the API provider.
You can pass auth details along with any request you send in Postman.
Auth data can be included in the header, body, or as parameters to a request.
If you enter your auth details in the Authorization tab, Postman will automatically populate the relevant parts of the request for your chosen auth type.
You can use variables and collections to define authorization details more safely and efficiently, letting you reuse the same information in multiple places.
API使用授权来确保客户端安全地访问数据。
这可能涉及对请求的发送者进行身份验证,并验证他们是否有权访问或操作相关数据
如果要构建API,则可以从多种身份验证模型中进行选择
如果您要集成第三方API,则所需的授权将由API提供程序指定
你能在postman中的任何请求中添加身份详细信息 Auth数据可以包含在header,body中,也可以作为请求的参数
如果在“Authorization”选项卡中输入身份验证详细信息,postman将自动为您选择的身份验证类型填充请求的相关部分
您可以使用变量和集合来更安全,更有效地定义授权详细信息,从而使您可以在多个位置重复使用相同的信息。
鉴权方式
postman 支持多种鉴权方式,具体如