0.9.5

2010-04-12 2 views
2

내의 URL @ 개발 : http://192.168.0.1:8888/com.company.MyEntryPoint/MyEntrypoint.html 내의 URL @ 라이브 ENV : 나는 사용자가 열려 ID를 사용하여 인증 할 필요가 http://www.example.com/com.company.MyEntryPoint/MyEntrypoint.html0.9.5

, 이 난에 내 영역을 할 방법입니다 수 :

AuthRequest authReq = 
    manager.authenticate(
     discovered, 
     returnToUrl, 
     "*.company.MyEntryPoint" 
    ); 

가 작동하지 않습니다 이 *

.company.MyEntryPoint

나는 영역을 지정하는 간단한 코드를 썼습니다. 예외 :

AuthRequest authReq = 
    manager.authenticate(
     discovered, 
     returnToUrl, 
     "http://localhost:8888/com.capgent.MyEntryPoint" 
    ); 

이 내 문제를 해결하는 것이 아니라 google과에 따라 :)

을 복잡하게 : 나는 시도하는 모든 조합의

org.openid4java.message.MessageException: 0x301: Realm verification failed (2) for: *.company.MyEntryPoint 
    at org.openid4java.message.AuthRequest.validate(AuthRequest.java:354) 
    at org.openid4java.message.AuthRequest.createAuthRequest(AuthRequest.java:101) 
    at org.openid4java.consumer.ConsumerManager.authenticate(ConsumerManager.java:1073) 

은 호기심의 일한 다음 open id spec 정상 작동 했음

전체 코드 조각 :

List discoveries = manager.discover(clientUrl); 
DiscoveryInformation discovered = manager.associate(discoveries); 
AuthRequest authReq = manager.authenticate(discovered, returnToUrl,"*.company.MyEntryPoint"); 
FetchRequest fetch = FetchRequest.createFetchRequest(); 
fetch.addAttribute("email", "http://schema.openid.net/contact/email", true); 
fetch.addAttribute("country", "http://axschema.org/contact/country/home", true); 
fetch.addAttribute("firstname", "http://axschema.org/namePerson/first", true); 
fetch.addAttribute("lastname", "http://axschema.org/namePerson/last", true); 
fetch.addAttribute("language", "http://axschema.org/pref/language", true); 
authReq.addExtension(fetch); 
String returnStr; 
if (!discovered.isVersion2()) 
{ 
    returnStr = authReq.getDestinationUrl(true); 
} 
else 
{ 
    returnStr = authReq.getDestinationUrl(false); 
} 

내가 여기서 잘못 했습니까?

+0

http://code.google.com/p/openid4java/source/browse/trunk/src/org/openid4java/server/RealmVerifier.java?r=631#164 업데이트 if (realmUrl.getAuthority(). startsWith ("*.")) realm = realm.replaceFirst ("\\ * \\.", "www."); –

답변

0

returnStr = authReq.getDestinationUrl (false); => returnStr = authReq.getDestinationUrl (true);