Upgrading Spring-security-oauth2 1.0.5.RELEASE to 2.0.5.RELEASE getting 404

故事扮演 提交于 2019-12-11 08:02:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!