1

如何正确配置我的 jdbcAuthorizationCodeService?

所以这是我的配置要点

  @Override
        public void configure(AuthorizationServerEndpointsConfigurer endpoints)
                throws Exception {
            endpoints
                    .tokenStore(this.tokenStore)
                    .authenticationManager(this.authenticationManager)
                    .authorizationCodeServices(this.jdbcAuthorizationCodeServices).userApprovalHandler(new DefaultUserApprovalHandler());
        }

我的桌子是这样构造的

在此处输入图像描述

我的问题是。身份验证列的样本值应该是什么?因为它是 bytea,根据 spring oauth2 的要求

4

1 回答 1

0

身份验证列将存储调用中收到的 OAuth2Authentication 对象的序列化版本。

这是来自 jdbcAuthorizationCodeService 类的代码

@Override
    protected void store(String code, OAuth2Authentication authentication) {
        jdbcTemplate.update(insertAuthenticationSql,
                new Object[] { code, new 
SqlLobValue(SerializationUtils.serialize(authentication)) }, new int[] {
                        Types.VARCHAR, Types.BLOB });
    }
于 2017-02-27T10:07:31.330 回答