简体   繁体   English

在 Spring Security 中获取访问令牌

[英]Get Access token in Spring Security

I am working under login to Google via OAuth2 spring-security I was successfully login via oauth2 and received Principal, but in my project requirements, I need also set to user principal access token, how can I do this?我正在通过 OAuth2 spring-security 登录 Google 我通过 oauth2 成功登录并收到了主体,但在我的项目要求中,我还需要设置用户主体访问令牌,我该怎么做?

Thank you, for you help谢谢你的帮助

If you can explain your scenario more, I can help better.如果你能更多地解释你的场景,我可以更好地提供帮助。 But generally in Spring Security you have to specify the Authorities for each of your system roles to have that user access the specified level.但通常在 Spring Security 中,您必须为每个系统角色指定 Authorities 才能让该用户访问指定级别。

在此处输入图片说明

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

相关问题 如何使用Spring Boot Security从Facebook获取访问令牌 - How to get access token from facebook using spring boot security 使用具有特定用例的 Spring 安全性获取访问令牌 - Get access token using Spring Security with a specific use-case 如何使用 Spring Security 5 在 Spring Boot 应用程序(不是 Web 应用程序)中获取 oauth2 访问令牌 - How to get oauth2 access token in a spring boot application (not a web application) using spring security 5 Spring Security + OAuth,如果缺少访问令牌,则进行回退 - Spring Security + OAuth, fallback if access token absent 获取控制器中Spring启动/安全性的会话令牌 - Get session token for Spring boot/security in controller 如何在spring oauth2安全性中登录successHandler后立即获取访问令牌? - How to get access token just after login in successHandler in spring oauth2 security? Spring boot security oauth2 从 cookie 中获取 access_token - Spring boot security oauth2 get access_token from cookie 尝试在 Spring Security oauth 2 中获取访问令牌之前出现 401 未经授权的错误 - 401 unauthorized error before trying to get access token in spring security oauth 2 使用 spring 安全性验证来自 Google 的访问令牌 - Verifying access token from Google using spring security 仅当资源在 spring 安全性中得到保护时,如何检查访问令牌? - How to check access token only if resource is secured in spring security?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM