【发布时间】:2015-02-04 20:57:30
【问题描述】:
为了保持一致性,更喜欢以编程方式配置 spring security oauth。该文档涵盖了 xml,但似乎没有提及程序配置。
xml(从示例项目中提取)配置的 Java 等效项是什么?
<oauth:consumer resource-details-service-ref="resourceDetails" oauth-failure-page="/oauth_error.jsp">
<oauth:url pattern="/google/**" resources="google"/>
<oauth:url pattern="/login/**" resources="none"/>
</oauth:consumer>
<oauth:resource-details-service id="resourceDetails">
<oauth:resource id="google" key="anonymous" secret="anonymous"
request-token-url="https://www.google.com/accounts/OAuthGetRequestToken"
user-authorization-url="https://www.google.com/accounts/OAuthAuthorizeToken"
access-token-url="https://www.google.com/accounts/OAuthGetAccessToken"
request-token-method="GET"
access-token-method="GET">
<oauth:addtionalParameter name="scope" value="https://picasaweb.google.com/data/"/>
<oauth:addtionalParameter name="xoauth_displayname" value="Tonr Example Application"/>
</oauth:resource>
</oauth:resource-details-service>
【问题讨论】:
标签: spring spring-mvc oauth spring-security spring-security-oauth2