问题
Im upgrading from spring-security-oauth2 1.0.5 to 2.0.5, is there any tutorial or good description of the differences to start with this? Im having a lot of issues because I have several customization's and all of them failed because there are a lot of differences and things like AuthorizationRequestHolder doesnt exists anymore and it is not easy to change it for simple AuthorizationRequest objects.
Thanks
回答1:
The main thing I noticed that changed was the token stores packages where changed so for example:
<bean id="tokenStore" class="org.springframework.security.oauth2.provider.token.InMemoryTokenStore" />
becomes
<bean id="tokenStore" class="org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore" />
Also previously in 1.0.5 I had used the TokenServicesUserApprovalHandler which I could no longer find in any of the packages. I removed the reference to that class and user-approval-handler-ref="userApprovalHandler" I had added to the oauth:authorization server. Mines seems to be working now on 2.0.5, hope this helps.
回答2:
You could start with
$ git diff 1.0.5.RELEASE 2.0.5.RELEASE -- samples/oauth2
The main differences are the move from XML to @Configuration
(which you could optionally skip). There is also a functional change to support approvals in the UI which is also optional. And that leaves the UserApprovalHandler
in which you can see the changes in the API and the use of AuthorizationRequest
. Other differences will depend on what you customized, but look at the framework extension points that you are using and the default implementations for information on how to migrate them. The main differences (as you noted) are with the AuthorizationRequest
which now is much more granular, and the extension points that affect it are OAuth2RequestFactory
and OAuth2RequestValidator
(both replacing AuthorizationRequestManager
).
If you want to trace the history look for "Amanda Anganes" in the log, since she was the main author. Commit 4f577389b3 is the first big change.
来源:https://stackoverflow.com/questions/27827214/upgrade-from-spring-oauth2-1-0-5-to-2-0-5