Question

// perform discovery on the user-supplied identifier
List discoveries = manager.discover(userSuppliedString);

// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate(discoveries);

// store the discovery information in the user's session
httpReq.getSession().setAttribute("openid-disc", discovered);

// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

How to create a dumb mode or stateless consumer without discovery and associate?

I have followed http://sureshatt.blogspot.com/2011/05/openid-dumb-mode-consumer-with.html, but openid4java still do an associate.

Was it helpful?

Solution

Discovery operation is needed for OpenID to work.

Regarding the dumb mode, here's an excerpt from the blogpost you have pointed:

Note that by default the consumer manager works in the smart mode and will take four attempts to create an association with the openid provider. Since we have set the number of attempts to zero, the method returns only the DiscoveryInformation object and would make no association though the name of the method is "associate".

According to it, that client program does operate in dumb mode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top