String realm, String returnTo)
{
if(!user.isAssociated())
throw new IllegalArgumentException("claimed_id of user has not been verified.");
UrlEncodedParameterMap map = new UrlEncodedParameterMap(user.getOpenIdServer());
String identity = user.getOpenIdDelegate();
if(identity==null)
identity = user.getClaimedId();
map.put(Constants.OPENID_NS, Constants.DEFAULT_NS);
map.put(Constants.OPENID_MODE, Constants.Mode.CHECKID_SETUP);
map.put(Constants.OPENID_TRUST_ROOT, trustRoot);
map.put(Constants.OPENID_REALM, realm);
map.put(Constants.OPENID_RETURN_TO, returnTo);
map.put(Constants.OPENID_ASSOC_HANDLE, user.getAssocHandle());
map.put(Constants.OPENID_IDENTITY, identity);
map.put(Constants.OPENID_CLAIMED_ID, identity);
return map;
}