Identifier id = discovered.getClaimedIdentifier(); return new OpenIDAuthenticationToken(OpenIDAuthenticationStatus.FAILURE, id == null ? "Unknown" : id.getIdentifier(), "Verification status message: [" + verification.getStatusMsg() + "]", Collections.<OpenIDAttribute> emptyList()); verified.getIdentifier(), "some message", attributes);
@Test(expected = OpenIDConsumerException.class) public void discoveryExceptionRaisesOpenIDException() throws Exception { ConsumerManager mgr = mock(ConsumerManager.class); OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new NullAxFetchListFactory()); when(mgr.discover(any())).thenThrow(new DiscoveryException("msg")); consumer.beginConsumption(new MockHttpServletRequest(), "", "", ""); }
public String toString() { return (isVersion2() ? "OpenID2" : "OpenID1") + "\nOP-endpoint:" + _opEndpoint + "\nClaimedID:" + _claimedIdentifier + "\nDelegate:" + _delegate; } }
public UrlIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { _urlIdentifier = normalize(identifier, removeFragment); }
/** * Does discovery on an identifier. It delegates the call to its * discovery manager. * * @return A List of {@link DiscoveryInformation} objects. * The list could be empty if no discovery information can * be retrieved. * @throws DiscoveryException if the discovery process runs into errors. */ public List discover(String identifier) throws DiscoveryException { return _discovery.discover(identifier); }
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { throw new RuntimeDiscoveryException("External entity found in XRDS data"); } });
public String toString() { return (isVersion2() ? "OpenID2" : "OpenID1") + "\nOP-endpoint:" + _opEndpoint + "\nClaimedID:" + _claimedIdentifier + "\nDelegate:" + _delegate; } }
.thenThrow(new MessageException("")) .thenThrow(new AssociationException("")) .thenThrow(new DiscoveryException(""));
public UrlIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { _urlIdentifier = normalize(identifier, removeFragment); }
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { throw new RuntimeDiscoveryException("External entity found in input data" ); } });
public String toString() { return (isVersion2() ? "OpenID2" : "OpenID1") + "\nOP-endpoint:" + _opEndpoint + "\nClaimedID:" + _claimedIdentifier + "\nDelegate:" + _delegate; } }
public DiscoveryInformation(URL opEndpoint, Identifier claimedIdentifier, String delegate, String version, Set types) throws DiscoveryException { if (opEndpoint == null) throw new DiscoveryException("Null OpenID Provider endpoint."); _opEndpoint = opEndpoint; _claimedIdentifier = claimedIdentifier; _delegate = delegate; _version = version; _types = types; }
public UrlIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { _urlIdentifier = normalize(identifier, removeFragment); }
public String toString() { return (isVersion2() ? "OpenID2" : "OpenID1") + "\nOP-endpoint:" + _opEndpoint + "\nClaimedID:" + _claimedIdentifier + "\nDelegate:" + _delegate; } }
public DiscoveryInformation(URL opEndpoint, Identifier claimedIdentifier, String delegate, String version, Set types) throws DiscoveryException { if (opEndpoint == null) { throw new DiscoveryException("Null OpenID Provider endpoint."); } _opEndpoint = opEndpoint; _claimedIdentifier = claimedIdentifier; _delegate = delegate; _version = version; _types = types; }
public UrlIdentifier(String identifier, boolean removeFragment) throws DiscoveryException { _urlIdentifier = normalize(identifier, removeFragment); }
public String toString() { return (isVersion2() ? "OpenID2" : "OpenID1") + "\nOP-endpoint:" + _opEndpoint + "\nClaimedID:" + _claimedIdentifier + "\nDelegate:" + _delegate; } }
public DiscoveryInformation(URL opEndpoint, Identifier claimedIdentifier, String delegate, String version, Set types) throws DiscoveryException { if (opEndpoint == null) throw new DiscoveryException("Null OpenID Provider endpoint."); _opEndpoint = opEndpoint; _claimedIdentifier = claimedIdentifier; _delegate = delegate; _version = version; _types = types; }
public DiscoveryInformation(URL opEndpoint, Identifier claimedIdentifier, String delegate, String version, Set types) throws DiscoveryException { if (opEndpoint == null) throw new DiscoveryException("Null OpenID Provider endpoint."); _opEndpoint = opEndpoint; _claimedIdentifier = claimedIdentifier; _delegate = delegate; _version = version; _types = types; }
public DiscoveryInformation(URL opEndpoint, Identifier claimedIdentifier, String delegate, String version, Set types) throws DiscoveryException { if (opEndpoint == null) throw new DiscoveryException("Null OpenID Provider endpoint."); _opEndpoint = opEndpoint; _claimedIdentifier = claimedIdentifier; _delegate = delegate; _version = version; _types = types; }