@Override public Map<String, String[]> getParameterMap() { return httpRequest.getParameters(); }
@Override public Map<String, String[]> getParameterMap() { return httpRequest.getParameters(); }
@Override public Enumeration<String> getParameterNames() { return Collections.enumeration(httpRequest.getParameters().keySet()); }
@Override public Enumeration<String> getParameterNames() { return Collections.enumeration(httpRequest.getParameters().keySet()); }
@Override public String[] getParameterValues(String name) { Assert.hasText(name); if (!httpRequest.getParameters().containsKey(name)) { return null; } return httpRequest.getParameters().get(name); }
@Override public String[] getParameterValues(String name) { Assert.hasText(name); if (!httpRequest.getParameters().containsKey(name)) { return null; } return httpRequest.getParameters().get(name); }
@Override public String getParameter(String name) { Assert.hasText(name); String[] parameterValue = httpRequest.getParameters().get(name); if (parameterValue == null || parameterValue.length == 0) { return null; } return parameterValue[0]; }
@Override public String getParameter(String name) { Assert.hasText(name); String[] parameterValue = httpRequest.getParameters().get(name); if (parameterValue == null || parameterValue.length == 0) { return null; } return parameterValue[0]; }
public AuthenticationRequest createFrom(HttpRequest httpRequest) { String authzHeaderValue = httpRequest.getHeader(AUTHORIZATION_HEADER); String[] schemeAndValue = getSchemeAndValue(authzHeaderValue); if (schemeAndValue == null) { RequestLocation[] requestLocations = getRequestLocations(httpRequest, false); if (requestLocations.length > 0) { return OAuthAuthenticationRequestFactory.INSTANCE.createRequest(httpRequest, requestLocations); } } else { if (schemeAndValue[0].equalsIgnoreCase(BEARER_AUTHENTICATION_SCHEME)) { RequestLocation[] requestLocations = getRequestLocations(httpRequest, true); return OAuthAuthenticationRequestFactory.INSTANCE.createRequest(httpRequest, requestLocations); } if (schemeAndValue[0].equalsIgnoreCase(BASIC_AUTHENTICATION_SCHEME)) { if (hasContentType(httpRequest.getHeader(CONTENT_TYPE_HEADER), MediaType.APPLICATION_FORM_URLENCODED_VALUE)) { Map<String, String[]> parameterMap = httpRequest.getParameters(); if (parameterMap != null && parameterMap.containsKey(GRANT_TYPE_PARAMETER)) { return OAuthAuthenticationRequestFactory.INSTANCE.createTokenRequest(httpRequest); } } return new DefaultBasicApiAuthenticationRequest(httpRequest); } } throw ApiAuthenticationExceptionFactory.newApiAuthenticationException(InvalidAuthenticationException.class); }
public AuthenticationRequest createFrom(HttpRequest httpRequest) { String authzHeaderValue = httpRequest.getHeader(AUTHORIZATION_HEADER); String[] schemeAndValue = getSchemeAndValue(authzHeaderValue); if (schemeAndValue == null) { RequestLocation[] requestLocations = getRequestLocations(httpRequest, false); if (requestLocations.length > 0) { return OAuthAuthenticationRequestFactory.INSTANCE.createRequest(httpRequest, requestLocations); } } else { if (schemeAndValue[0].equalsIgnoreCase(BEARER_AUTHENTICATION_SCHEME)) { RequestLocation[] requestLocations = getRequestLocations(httpRequest, true); return OAuthAuthenticationRequestFactory.INSTANCE.createRequest(httpRequest, requestLocations); } if (schemeAndValue[0].equalsIgnoreCase(BASIC_AUTHENTICATION_SCHEME)) { if (hasContentType(httpRequest.getHeader(CONTENT_TYPE_HEADER), MediaType.APPLICATION_FORM_URLENCODED_VALUE)) { Map<String, String[]> parameterMap = httpRequest.getParameters(); if (parameterMap != null && parameterMap.containsKey(GRANT_TYPE_PARAMETER)) { return OAuthAuthenticationRequestFactory.INSTANCE.createTokenRequest(httpRequest); } } return new DefaultBasicApiAuthenticationRequest(httpRequest); } } throw ApiAuthenticationExceptionFactory.newApiAuthenticationException(InvalidAuthenticationException.class); }