1

Consider the following code excerpt:

            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);
            }
        }

Authentication with Google works, however, can anyone tell me how to extract the actual openID-identifier-URL from the objects I'm using here? When the authentication succeeds, it lets me now by writing "INFO: Verification succeeded for: https://www.google.com/accounts/o8/id?blablabla", but so far, I haven't found a way to access this very URL in the program. Could someone help me out please?

PS: I have been going through older posts dealing with openID4java. However, they all deal with failed authentication and the likes, which for me isn't the problem. If this very question has been asked before, I apologise.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360

0 Answers0