I’ve setup up an Oath2 resttemplate client.When it comes back from authenticating with the remote service,it tries to convert the Userinfo from XML to util.Map and dies with
o.s.b.a.s.o.r.UserInfoTokenServices - Could not fetch user details: class org.springframework.web.client.UnknownContentTypeException, Could not extract response: no suitable HttpMessageConverter found for response type [interface java.util.Map] and content type [application/xml;charset=UTF-8]
The XML it receives is like :
"<root><userinfo userid="Userxxx " lastname="xxx" firstname="xxx" /></root>"
I think there are two options :
- Somehow turn off the automatic check Spring does with UserInfoTokenServices
2.add to resttemplate a converter with setMessageConverters
I don’t know if the first is possible.
As fas as the second goes I’ve made an XStream MapEntryConverter but Resttemplate wants a HttpMessageConverter.
And why does by default UserInfoTokenServices require a hashmap? Is there an alternative way ?