简体   繁体   English

OWIN Cookie和不记名令牌是否相同?

[英]Are OWIN Cookie & Bearer Tokens the same?

When I call the OWIN /token endpoint I get the bearer token in the response and a set-cookie header that has a token. 当我调用OWIN /token端点时,我在响应中获得了承载令牌,并获得了一个带有令牌的set-cookie标头。 Are these tokens the same? 这些标记是否相同? If not how do I make them the same? 如果没有,我如何使它们相同?

No they are not the same, the token you receive is the access token needed to access your protected API (APIs attribute with [Authorize] ) and contains all the claims you want to encode inside it. 不,它们不是一样的,您收到的令牌是访问受保护的API所需的访问令牌(带有[Authorize] APIs属性),并且包含您要在其中编码的所有声明。

I've not seen token inside cookie returned when you call /token end point. 当您调用/ token端点时,我还没有看到cookie内的令牌返回。 Anyhow you usually depend on tokens or cookies for security not both. 无论如何,您通常都依赖令牌或cookie来确保安全性,而不是两者都依赖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM