简体   繁体   English

Spring Security OAuth2 cookie

[英]Spring Security OAuth2 cookies

I have OAuth2 implemented in my app with Spring Security. 我在我的应用程序中使用Spring Security实现了OAuth2。 Currently, it works with the "access_token" request parameter. 当前,它与“ access_token”请求参数一起使用。 Where can I add some customization to also accept the token from a cookie? 在哪里可以添加一些自定义项以也接受来自cookie的令牌?

You cannot get the token from a Cookie - using oAuth, the only way to get it is via a call to the oAuth server, getting a code, and then getting the token... You can read the oAuth spec . 您无法从Cookie中获取令牌-使用oAuth,获取令牌的唯一方法是通过调用oAuth服务器,获取代码并获取令牌...。您可以阅读oAuth规范

If you talk about the application-end (and not the oAuth), it might be possible. 如果您谈论应用程序端(而不是oAuth),则有可能。 Checking the token is the responsibility of the application that holds the protexcted resource. 检查令牌是持有受保护资源的应用程序的责任。 There, rather than getting the token from the header of the request, it can check a Cookie instead. 在这里,与其从请求的标头获取令牌,不如检查Cookie。

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

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