@Test public void verifyGetAssociationResponse() { request.addParameter("openid.mode", "associate"); request.addParameter("openid.session_type", "DH-SHA1"); request.addParameter("openid.assoc_type", "HMAC-SHA1"); request.addParameter("openid.dh_consumer_public", "NzKoFMyrzFn/5iJFPdX6MVvNA/BChV1/sJdnYbupDn7ptn+cerwEzyFfWFx25KsoLSkxQCaSMmYtc1GPy/2GI1BSKSDhpdJmDBb" + "QRa/9Gs+giV/5fHcz/mHz8sREc7RTGI+0Ka9230arwrWt0fnoaJLRKEGUsmFR71rCo4EUOew="); final Map<String, String> assocResponse = smartOpenIdController.getAssociationResponse(request); assertTrue(assocResponse.containsKey("assoc_handle")); assertTrue(assocResponse.containsKey("expires_in")); assertTrue(assocResponse.containsKey("dh_server_public")); assertTrue(assocResponse.containsKey("enc_mac_key")); request.removeParameter("openid.mode"); }
public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message response = null; if (StringUtils.equals(mode, OpenIdConstants.ASSOCIATE)) { response = serverManager.associationResponse(parameters); } final Map<String, String> responseParams = new HashMap<>(); if (response != null) { responseParams.putAll(response.getParameterMap()); } return responseParams; }
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message response = null; if (StringUtils.equals(mode, OpenIdConstants.ASSOCIATE)) { response = serverManager.associationResponse(parameters); } final Map<String, String> responseParams = new HashMap<>(); if (response != null) { responseParams.putAll(response.getParameterMap()); } return responseParams; } }
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message response = null; if (StringUtils.equals(mode, OpenIdConstants.ASSOCIATE)) { response = serverManager.associationResponse(parameters); } final Map<String, String> responseParams = new HashMap<>(); if (response != null) { responseParams.putAll(response.getParameterMap()); } return responseParams; }  }
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message response = null; if (StringUtils.equals(mode, OpenIdConstants.ASSOCIATE)) { response = serverManager.associationResponse(parameters); } final Map<String, String> responseParams = new HashMap<>(); if (response != null) { responseParams.putAll(response.getParameterMap()); } return responseParams; }  Map<String, String> getAssociationResponse(final HttpServletRequest request); @Override boolean canHandle(final HttpServletRequest request, final HttpServletResponse response); void setSuccessView(final String successView); void setFailureView(final String failureView); @NotNull void setServerManager(final ServerManager serverManager); }
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID_MODE) ? parameters.getParameterValue(OpenIdConstants.OPENID_MODE) : null; Message response = null; if (StringUtils.equals(mode, OpenIdConstants.ASSOCIATE)) { response = serverManager.associationResponse(parameters); } final Map<String, String> responseParams = new HashMap<>(); if (response != null) { responseParams.putAll(response.getParameterMap()); } return responseParams; }  Map<String, String> getAssociationResponse(final HttpServletRequest request); @Override boolean canHandle(final HttpServletRequest request, final HttpServletResponse response); void setSuccessView(final String successView); void setFailureView(final String failureView); @NotNull void setServerManager(final ServerManager serverManager);  }