민서네집

[OpenID4Java] Local signature verification failed 에러 본문

Java

[OpenID4Java] Local signature verification failed 에러

브라이언7 2013. 8. 24. 03:08

Google 과 연동하기 위해 프로젝트에서 OpenID4Java 라이브러리를 사용하는데, 보통은 잘 되는데, Google 로그인이 안되는 사람도 있었다.


안되는 사람 것으로 디버깅을 해보면


// examine the verification result and extract the verified identifier

Identifier verified = verification.getVerifiedId();


위 코드에서 verified 변수가 null 이 나오는 경우이다.

디버그 하면서 verification 객체를 들여다보면

Local signature verification failed 라는 메시지가 보이고, 어떤 글자는 깨지지 않았는데, 어떤 글자는 한글이 깨진 것을 볼 수 있었다.

- Google 에 등록된 email 아이디의 성과 이름이 한글로 되어 있어서 글자가 깨지는 경우

Google 에서 Local signature verification failed 라는 오류 메시지를 찾아보니 원인을 알 수 있었다.


해결책은 Tomcat 서버의 conf/server.xml 파일에서 Connector 태그의 속성으로 URIEncoding="UTF-8" 을 주면 된다.

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>

Comments