Spring mvc 如何在spring中编写oauth客户端?
我在网上找到了这个例子,他们通常使用Spring mvc 如何在spring中编写oauth客户端?,spring-mvc,oauth,Spring Mvc,Oauth,我在网上找到了这个例子,他们通常使用curl或类似http://localhost:8080/demo4ssh-security-oauth2/oauth/token?客户端id=mobile\u 1和客户端机密=secret\u 1和授权类型=password&username=wangwu&password=234567来测试oauth。 它将获得访问令牌 然后使用http://localhost:8080/demo4ssh-security-oauth2/json?访问令牌=5aa5e5f
curl
或类似http://localhost:8080/demo4ssh-security-oauth2/oauth/token?客户端id=mobile\u 1和客户端机密=secret\u 1和授权类型=password&username=wangwu&password=234567来测试oauth。
它将获得访问令牌
然后使用http://localhost:8080/demo4ssh-security-oauth2/json?访问令牌=5aa5e5f9-43eb-49e3-8149-69406884cbd9
以获取资源
但是在我的spring mvc代码中,我如何做这两个操作呢??
我不知道从哪里开始?
我看到了spring security oauth2示例(sparkr
和tonr
)。
但我仍然不知道它在tonr
中的何处编写此操作
请给我一个简单的例子或解释如何做到这一点,谢谢你,Spring已经提供了这个例子。签出并添加注释
建议您首先对OAuth2舞蹈有一些了解,以便更好地理解。建议
这说明了如何配置和使用Oauth2保护的资源