问题
Getting 404 on authorizationcode and accesstoken service I am Trying to upgrade spring security oauth2 from 1.0.5.Release to 2.0.5.Release.
I am using spring security 3.2.5 version,spring core 3.2.13 and spring oauth2 2.0.5.Release.
- Do we need spring 4 for spring-oauth2-2.0.5.Release?
- Do I need to use java config for spring-oauth2-2.0.5.Release?
- When I use the same xml config which works in 1.0.5 doesnot work in spring-oauth2-2.0.5.Release?
回答1:
Do we need spring 4 for spring-oauth2-2.0.5.Release?
Yes, I believe so.
Do I need to use java config for spring-oauth2-2.0.5.Release?
No.
When I use the same xml config which works in 1.0.5 doesnot work in spring-oauth2-2.0.5.Release?
Is that a question? It should work, but without more details it's going to be hard to say. There are some API changes in 2.0, so depending on the customization you did, you may or may not have to re-implement bits of it.
A 404 is pretty generic, so maybe your whole application just failed to start? Impossible to say without more data.
回答2:
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.
来源:https://stackoverflow.com/questions/28158126/upgrading-spring-security-oauth2-1-0-5-release-to-2-0-5-release-getting-404