0
爲了保持一致性,更喜歡逐步配置spring安全性oauth。該文檔涵蓋了xml,但似乎沒有提到progmatic配置。Progmatically配置Spring安全OAuth
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>