gpt4 book ai didi

java - Spring Oauth2 JdbcTokenStore Oracle 数据库

转载 作者:行者123 更新时间:2023-12-01 11:21:17 44 4
gpt4 key购买 nike

我正在尝试在此处转换 jdbctoken 存储架构 https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql

CREATE TABLE EISBIT.OAUTH_ACCESS_TOKEN
(
TOKEN_ID VARCHAR2(256 BYTE),
TOKEN CLOB,
AUTHENTICATION_ID VARCHAR2(256 BYTE),
USER_NAME VARCHAR2(256 BYTE),
CLIENT_ID VARCHAR2(256 BYTE),
AUTHENTICATION CLOB,
REFRESH_TOKEN VARCHAR2(256 BYTE)
)

@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints
.tokenStore(tokenStore())
.authenticationManager(this.authenticationManager);
}

但是当我尝试时遇到这个异常

2015-07-03 14:34:01.300  WARN 10952 --- [pr-8080-exec-13] o.s.s.o.p.token.store.JdbcTokenStore     : Failed to deserialize access token for b14fa3b1-5a5a-4d0c-9112-416997c2dc83

java.lang.IllegalArgumentException: java.io.StreamCorruptedException: invalid stream header: 00540001
at org.springframework.security.oauth2.common.util.SerializationUtils.deserialize(SerializationUtils.java:40)
at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.deserializeAccessToken(JdbcTokenStore.java:397)
at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$2.mapRow(JdbcTokenStore.java:162)
at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$2.mapRow(JdbcTokenStore.java:1)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:708)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:727)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:811)
at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.readAccessToken(JdbcTokenStore.java:160)

尝试读取 token 库时出错:(..

最佳答案

将 CLOB 修改为 BLOB

CREATE TABLE EISBIT.OAUTH_ACCESS_TOKEN
(
TOKEN_ID VARCHAR2(256 BYTE),
TOKEN BLOB,
AUTHENTICATION_ID VARCHAR2(256 BYTE),
USER_NAME VARCHAR2(256 BYTE),
CLIENT_ID VARCHAR2(256 BYTE),
AUTHENTICATION BLOB,
REFRESH_TOKEN VARCHAR2(256 BYTE)
)

关于java - Spring Oauth2 JdbcTokenStore Oracle 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31201421/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com