org.openid4java.message.Message.getParameterMap()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(282)

本文整理了Java中org.openid4java.message.Message.getParameterMap()方法的一些代码示例,展示了Message.getParameterMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getParameterMap()方法的具体详情如下:
包路径:org.openid4java.message.Message
类名称:Message
方法名:getParameterMap

Message.getParameterMap介绍

暂无

代码示例

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

  1. /**
  2. * Gets the OpenID message as a ParameterList.
  3. *
  4. * @return ParameterList containing the OpenID message.
  5. */
  6. public ParameterList getOpenIDParams() {
  7. return new ParameterList(_openidMessage.getParameterMap());
  8. }

代码示例来源:origin: org.openid4java/openid4java-nodeps

  1. /**
  2. * Gets the OpenID message as a ParameterList.
  3. * @return ParameterList containing the OpenID message.
  4. */
  5. public ParameterList getOpenIDParams()
  6. {
  7. return new ParameterList(_openidMessage.getParameterMap());
  8. }

代码示例来源:origin: org.apereo.cas/cas-server-support-openid

  1. /**
  2. * We sign directly (final 'true') because we don't add extensions
  3. * response message can be either a DirectError or an AuthSuccess here.
  4. * Note:
  5. * The association handle returned in the Response is either the 'public'
  6. * created in a previous association, or is a 'private' handle created
  7. * specifically for the verification step when in non-association mode
  8. *
  9. * @param service the service
  10. * @param parameters the parameters
  11. * @param successFullAuthentication the success full authentication
  12. * @param id the id
  13. * @param parameterList the parameter list
  14. * @return response response
  15. */
  16. protected Response buildAuthenticationResponse(final OpenIdService service,
  17. final Map<String, String> parameters,
  18. final boolean successFullAuthentication,
  19. final String id,
  20. final ParameterList parameterList) {
  21. val response = serverManager.authResponse(parameterList, id, id, successFullAuthentication, true);
  22. parameters.putAll(response.getParameterMap());
  23. LOGGER.debug("Parameters passed for the OpenID response are [{}]", parameters.keySet());
  24. return buildRedirect(service, parameters);
  25. }

代码示例来源:origin: org.jasig.cas/cas-server-support-openid

  1. /**
  2. * We sign directly (final 'true') because we don't add extensions
  3. * response message can be either a DirectError or an AuthSuccess here.
  4. *
  5. * @param serverManager the server manager
  6. * @param ticketId the ticket id
  7. * @param service the service
  8. * @param parameters the parameters
  9. * @param associated the associated
  10. * @param successFullAuthentication the success full authentication
  11. * @param id the id
  12. * @return response response
  13. */
  14. protected Response buildAuthenticationResponse(final ServerManager serverManager,
  15. final String ticketId, final OpenIdService service,
  16. final Map<String, String> parameters,
  17. final boolean associated, final boolean successFullAuthentication,
  18. final String id) {
  19. final Message response = serverManager.authResponse(this.parameterList, id, id,
  20. successFullAuthentication, true);
  21. parameters.putAll(response.getParameterMap());
  22. if (!associated) {
  23. parameters.put(OpenIdProtocolConstants.OPENID_ASSOCHANDLE, ticketId);
  24. }
  25. return buildRedirect(service, parameters);
  26. }

代码示例来源:origin: org.jasig.cas/cas-server-support-openid

  1. /**
  2. * Gets the association response. Determines the mode first.
  3. * If mode is set to associate, will set the response. Then
  4. * builds the response parameters next and returns.
  5. *
  6. * @param request the request
  7. * @return the association response
  8. */
  9. public Map<String, String> getAssociationResponse(final HttpServletRequest request) {
  10. final ParameterList parameters = new ParameterList(request.getParameterMap());
  11. final String mode = parameters.hasParameter(OpenIdProtocolConstants.OPENID_MODE)
  12. ? parameters.getParameterValue(OpenIdProtocolConstants.OPENID_MODE)
  13. : null;
  14. Message response = null;
  15. if (StringUtils.equals(mode, OpenIdProtocolConstants.ASSOCIATE)) {
  16. response = serverManager.associationResponse(parameters);
  17. }
  18. final Map<String, String> responseParams = new HashMap<>();
  19. if (response != null) {
  20. responseParams.putAll(response.getParameterMap());
  21. }
  22. return responseParams;
  23. }

代码示例来源:origin: org.apereo.cas/cas-server-support-openid

  1. /**
  2. * Gets the association response. Determines the mode first.
  3. * If mode is set to associate, will set the response. Then
  4. * builds the response parameters next and returns.
  5. *
  6. * @param request the request
  7. * @return the association response
  8. */
  9. public Map<String, String> getAssociationResponse(final HttpServletRequest request) {
  10. val parameters = new ParameterList(request.getParameterMap());
  11. val mode = parameters.hasParameter(OpenIdProtocolConstants.OPENID_MODE)
  12. ? parameters.getParameterValue(OpenIdProtocolConstants.OPENID_MODE)
  13. : null;
  14. val response = FunctionUtils.doIf(StringUtils.equals(mode, OpenIdProtocolConstants.ASSOCIATE),
  15. () -> this.serverManager.associationResponse(parameters),
  16. () -> null)
  17. .get();
  18. val responseParams = new HashMap<String, String>();
  19. if (response != null) {
  20. responseParams.putAll(response.getParameterMap());
  21. }
  22. return responseParams;
  23. }

代码示例来源:origin: com.cloudbees/openid4java-shaded

  1. /**
  2. * Makes a HTTP call to the specified URL with the parameters specified
  3. * in the Message.
  4. *
  5. * @param url URL endpoint for the HTTP call
  6. * @param request Message containing the parameters
  7. * @param response ParameterList that will hold the parameters received in
  8. * the HTTP response
  9. * @return the status code of the HTTP call
  10. */
  11. private int call(String url, Message request, ParameterList response)
  12. throws MessageException
  13. {
  14. int responseCode = -1;
  15. try
  16. {
  17. if (DEBUG) _log.debug("Performing HTTP POST on " + url);
  18. HttpResponse resp = _httpFetcher.post(url, request.getParameterMap());
  19. responseCode = resp.getStatusCode();
  20. String postResponse = resp.getBody();
  21. response.copyOf(ParameterList.createFromKeyValueForm(postResponse));
  22. if (DEBUG) _log.debug("Retrived response:\n" + postResponse);
  23. }
  24. catch (IOException e)
  25. {
  26. _log.error("Error talking to " + url +
  27. " response code: " + responseCode, e);
  28. }
  29. return responseCode;
  30. }

代码示例来源:origin: org.openid4java/openid4java-nodeps

  1. /**
  2. * Makes a HTTP call to the specified URL with the parameters specified
  3. * in the Message.
  4. *
  5. * @param url URL endpoint for the HTTP call
  6. * @param request Message containing the parameters
  7. * @param response ParameterList that will hold the parameters received in
  8. * the HTTP response
  9. * @return the status code of the HTTP call
  10. */
  11. private int call(String url, Message request, ParameterList response)
  12. throws MessageException
  13. {
  14. int responseCode = -1;
  15. try
  16. {
  17. if (DEBUG) _log.debug("Performing HTTP POST on " + url);
  18. HttpResponse resp = _httpFetcher.post(url, request.getParameterMap());
  19. responseCode = resp.getStatusCode();
  20. String postResponse = resp.getBody();
  21. response.copyOf(ParameterList.createFromKeyValueForm(postResponse));
  22. if (DEBUG) _log.debug("Retrived response:\n" + postResponse);
  23. }
  24. catch (IOException e)
  25. {
  26. _log.error("Error talking to " + url +
  27. " response code: " + responseCode, e);
  28. }
  29. return responseCode;
  30. }

代码示例来源:origin: org.openid4java/openid4java

  1. /**
  2. * Makes a HTTP call to the specified URL with the parameters specified
  3. * in the Message.
  4. *
  5. * @param url URL endpoint for the HTTP call
  6. * @param request Message containing the parameters
  7. * @param response ParameterList that will hold the parameters received in
  8. * the HTTP response
  9. * @return the status code of the HTTP call
  10. */
  11. private int call(String url, Message request, ParameterList response)
  12. throws MessageException
  13. {
  14. int responseCode = -1;
  15. try
  16. {
  17. if (DEBUG) _log.debug("Performing HTTP POST on " + url);
  18. HttpResponse resp = _httpFetcher.post(url, request.getParameterMap());
  19. responseCode = resp.getStatusCode();
  20. String postResponse = resp.getBody();
  21. response.copyOf(ParameterList.createFromKeyValueForm(postResponse));
  22. if (DEBUG) _log.debug("Retrived response:\n" + postResponse);
  23. }
  24. catch (IOException e)
  25. {
  26. _log.error("Error talking to " + url +
  27. " response code: " + responseCode, e);
  28. }
  29. return responseCode;
  30. }

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

  1. /**
  2. * Makes a HTTP call to the specified URL with the parameters specified
  3. * in the Message.
  4. *
  5. * @param url URL endpoint for the HTTP call
  6. * @param request Message containing the parameters
  7. * @param response ParameterList that will hold the parameters received in
  8. * the HTTP response
  9. * @return the status code of the HTTP call
  10. */
  11. private int call(String url, Message request, ParameterList response)
  12. throws MessageException {
  13. int responseCode = -1;
  14. try {
  15. if (DEBUG) {
  16. _log.debug("Performing HTTP POST on " + url);
  17. }
  18. HttpResponse resp = _httpFetcher.post(url, request.getParameterMap());
  19. responseCode = resp.getStatusCode();
  20. String postResponse = resp.getBody();
  21. response.copyOf(ParameterList.createFromKeyValueForm(postResponse));
  22. if (DEBUG) {
  23. _log.debug("Retrived response:\n" + postResponse);
  24. }
  25. } catch (IOException e) {
  26. _log.error("Error talking to " + url +
  27. " response code: " + responseCode, e);
  28. }
  29. return responseCode;
  30. }

代码示例来源:origin: jbufu/openid4java

  1. /**
  2. * Makes a HTTP call to the specified URL with the parameters specified
  3. * in the Message.
  4. *
  5. * @param url URL endpoint for the HTTP call
  6. * @param request Message containing the parameters
  7. * @param response ParameterList that will hold the parameters received in
  8. * the HTTP response
  9. * @return the status code of the HTTP call
  10. */
  11. private int call(String url, Message request, ParameterList response)
  12. throws MessageException
  13. {
  14. int responseCode = -1;
  15. try
  16. {
  17. if (DEBUG) _log.debug("Performing HTTP POST on " + url);
  18. HttpResponse resp = _httpFetcher.post(url, request.getParameterMap());
  19. responseCode = resp.getStatusCode();
  20. String postResponse = resp.getBody();
  21. response.copyOf(ParameterList.createFromKeyValueForm(postResponse));
  22. if (DEBUG) _log.debug("Retrived response:\n" + postResponse);
  23. }
  24. catch (IOException e)
  25. {
  26. _log.error("Error talking to " + url +
  27. " response code: " + responseCode, e);
  28. }
  29. return responseCode;
  30. }

代码示例来源:origin: org.restlet.jse/org.restlet.example

  1. @SuppressWarnings("unchecked")
  2. Map<String, String> m = (Map<String, String>) response
  3. .getParameterMap();
  4. for (String key : m.keySet()) {
  5. f.add(key, m.get(key));

代码示例来源:origin: be.fedict.eid-idp/eid-idp-protocol-openid

  1. Map<String, String> parameters = message.getParameterMap();
  2. ReturnResponse returnResponse = new ReturnResponse(destinationUrl);
  3. for (String paramKey : parameters.keySet()) {

相关文章