我正在尝试在这里转换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)
尝试读取令牌库时出现
错误:(..
答案 0 :(得分:1)
将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)
)
答案 1 :(得分:0)
答案 2 :(得分:0)
您必须将此映射到Oracle中的RAW或LONG RAW数据类型。 我们遇到了此异常,因此不得不更改OAUTH表中的以下字段。
OAUTH_ACCESS_TOKEN
令牌 RAW
认证原始版本
REFRESH_TOKEN RAW
OAUTH_REFRESH_TOKEN
令牌 RAW
身份验证长RAW