使用openid4java检索openID url
考虑以下代码摘录:使用openid4java检索openID url,java,url,openid4java,Java,Url,Openid4java,考虑以下代码摘录: String openIDProviderURL = "https://www.google.com/accounts/o8/id"; try { URI loc = getUI().getPage().getLocation(); List discoveries = manager.discover(openIDProviderURL);
String openIDProviderURL = "https://www.google.com/accounts/o8/id";
try {
URI loc = getUI().getPage().getLocation();
List discoveries = manager.discover(openIDProviderURL);
DiscoveryInformation discovered = manager.associate(discoveries);
getUI().getSession().setAttribute("openid-disc", discovered);
AuthRequest authReq = manager.authenticate(discovered, "http://"+loc.getHost()+":"+loc.getPort()+loc.getPath());
FetchRequest fetch = FetchRequest.createFetchRequest();
authReq.addExtension(fetch);
System.out.println("DEST URL: "+authReq.getDestinationUrl(true));
getUI().getPage().setLocation(authReq.getDestinationUrl(true));
} catch (DiscoveryException ex) {
Logger.getLogger(NavigatorUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (MessageException ex) {
Logger.getLogger(NavigatorUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConsumerException ex) {
Logger.getLogger(NavigatorUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
然而,使用GoogleWorks进行身份验证,有人能告诉我如何从我在这里使用的对象中提取实际的openID标识符URL吗?当身份验证成功时,我现在可以通过编写“INFO:Verification successed for:https://www.google.com/accounts/o8/id?blablabla
”,但到目前为止,我还没有找到在程序中访问这个URL的方法。有人能帮帮我吗
PS:我一直在浏览有关openID4java的老文章。但是,它们都处理身份验证失败之类的问题,这对我来说不是问题。如果这个问题以前被问过,我道歉