Spring OAuth2:无法从ClientDetailsS​​ervice获取其他信息

时间:2017-04-28 09:27:56

标签: spring spring-security oauth-2.0 spring-oauth2

我在Spring Security中使用OAuth2。 我的身份验证管理器通过数据库配置客户端:clients.jdbc(dataSource());

一切正常,但在请求令牌时,我得到一个例外:

2017-04-28 11:14:39.656  WARN 1200 --- [io-8096-exec-10] o.s.s.o.p.c.JdbcClientDetailsService     : Could not decode JSON for additional information: BaseClientDetails [clientId=myclientid, clientSecret=mysecret, scope=[myscope], resourceIds=[], authorizedGrantTypes=[authorization_code, refresh_token], registeredRedirectUris=null, authorities=[], accessTokenValiditySeconds=36000, refreshTokenValiditySeconds=36000, additionalInformation={}]
带跟踪的

org.codehaus.jackson.JsonParseException: Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@557a138f; line: 1, column: 2]
...
...

additional_information中的列varchar(4096)client_details)对于此条目而言是“asdf”。

我还尝试将additional_information的类型从String更改为Map<String, Object>并插入字符串,方法是使用键'info'将其放入地图中。在此之后,我得到了相同的错误,具有不同的跟踪:

org.codehaus.jackson.JsonParseException: Unrecognized token 'asdf': was expecting at [Source: java.io.StringReader@3e8a7a77; line: 1, column: 21]
...
...

如何将additional_information加入我的令牌?

0 个答案:

没有答案