2014-09-09 6 views
0

저는 현재 봄 보안 휴식 (URL)과 memcache를 사용하려고합니다. 내 봄 보안 설정 나머지를 확인하기 위해 MySQL과 함께 gorm을 사용했고 정상적으로 작동합니다.Grails + Spring Security Rest + Memcached

지금은 대신 MySQL을

의 세션을 저장하기 위해 memcached를를 사용하고자하는

처럼 여기 주목된다

http://alvarosanchez.github.io/grails-spring-security-rest/docs/guide/single.html#authentication

나는이 구성 설정해야합니다 :

구성 키 기본값 값

grails.plugin.springsecurity.rest.token.storage.useMemcached true 
grails.plugin.springsecurity.rest.token.storage.memcached.hosts localhost:11211 
grails.plugin.springsecurity.rest.token.storage.memcached.username '' 
grails.plugin.springsecurity.rest.token.storage.memcached.password '' 
grails.plugin.springsecurity.rest.token.storage.memcached.expiration 3600 

나는 그것을했고 나는 문제가있다. 내 토큰이 memcache에 성공적으로 저장되었지만 "Autorisation : Bearer {MyToken}"과 함께 'url : 8080/myapp/api/validate'경로를 사용하여 토큰의 유효성을 검사하려고하면 API에서 401 오류 코드를 보냅니다.

스택 추적 :

014-09-09 12:30:17,265 [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] DEBUG memcached.MemcachedConnection - Read 816 bytes 
2014-09-09 12:30:17,265 [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] DEBUG binary.GetAndTouchOperationImpl - Reading 24 header bytes 
2014-09-09 12:30:17,265 [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] DEBUG binary.GetAndTouchOperationImpl - Reading 792 payload bytes 
2014-09-09 12:30:17,268 [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] WARN transcoders.SerializingTranscoder - Caught CNFE decoding 788 bytes of data 
Message: org.springframework.security.core.userdetails.User$AuthorityComparator 
    Line | Method 
->> 366 | run      in java.net.URLClassLoader$1 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 355 | run      in  '' 
| 354 | findClass . . . . . . . in java.net.URLClassLoader 
| 425 | loadClass    in java.lang.ClassLoader 
| 358 | loadClass . . . . . . . in  '' 
| 270 | forName     in java.lang.Class 
| 625 | resolveClass . . . . . in java.io.ObjectInputStream 
| 1612 | readNonProxyDesc  in  '' 
| 1517 | readClassDesc . . . . . in  '' 
| 1771 | readOrdinaryObject  in  '' 
| 1350 | readObject0 . . . . . . in  '' 
| 370 | readObject    in  '' 
| 522 | readObject . . . . . . in java.util.TreeSet 
| 1017 | invokeReadObject  in java.io.ObjectStreamClass 
| 1893 | readSerialData . . . . in java.io.ObjectInputStream 
| 1798 | readOrdinaryObject  in  '' 
| 1350 | readObject0 . . . . . . in  '' 
| 1990 | defaultReadFields  in  '' 
| 1915 | readSerialData . . . . in  '' 
| 1798 | readOrdinaryObject  in  '' 
| 1350 | readObject0 . . . . . . in  '' 
| 1990 | defaultReadFields  in  '' 
| 1915 | readSerialData . . . . in  '' 
| 1798 | readOrdinaryObject  in  '' 
| 1350 | readObject0 . . . . . . in  '' 
| 370 | readObject    in  '' 
| 129 | deserialize . . . . . . in net.spy.memcached.transcoders.BaseSerializingTranscoder 
|  88 | decode     in net.spy.memcached.transcoders.SerializingTranscoder 
| 1439 | gotData . . . . . . . . in net.spy.memcached.MemcachedClient$8 
|  61 | decodePayload   in net.spy.memcached.protocol.binary.GetAndTouchOperationImpl 
| 204 | finishedPayload . . . . in net.spy.memcached.protocol.binary.OperationImpl 
| 194 | readPayloadFromBuffer in  '' 
| 137 | readFromBuffer . . . . in  '' 
| 813 | readBufferAndLogMetrics in net.spy.memcached.MemcachedConnection 
| 792 | handleReads . . . . . . in  '' 
| 672 | handleReadsAndWrites in  '' 
| 635 | handleIO . . . . . . . in  '' 
| 409 | handleIO    in  '' 
^ 1334 | run . . . . . . . . . . in  '' 
2014-09-09 12:30:17,280 [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] DEBUG binary.GetAndTouchOperationImpl - Transitioned state from READING to COMPLETE 

답변

0

객체의 직렬화가 실패합니다. 맞춤 사용자 세부 정보 클래스를 사용하고 있습니까? 그렇다면 직렬 버전 UID를 지정했는지 확인하십시오.

관련 문제