如何开发仅公开Rest API并通过Google或GitHub访问令牌授权请求的Spring Boot应用程序?

我已经开发了一个Spring-boot Web应用程序,该应用程序仅公开了宁静的API,以及那些将由angular应用程序或android应用程序使用的端点。

现在,我需要根据用户偏好通过Google,Facebook或GitHub OAuth2访问令牌授权那些Restful API请求,但我不确定该怎么做。

nuinuiweiwei 回答:如何开发仅公开Rest API并通过Google或GitHub访问令牌授权请求的Spring Boot应用程序?

您可以使用Spring Security来实现它。您可以在网上找到很多文章。 例如,选中this

,

查看官方的Spring Boot指南Spring Boot and OAuth2。它描述了一个应用程序,该应用程序以简单的单提供商单点登录开始,并通过选择的GitHubGoogle身份验证提供程序与客户端一起工作。

本文链接:https://www.f2er.com/2643206.html

大家都在问