Skip to content
Permalink
Browse files
[CXF-5561] More updates
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1567908 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Sergey Beryozkin committed Feb 13, 2014
1 parent 1e7c47d commit 39e35f4f5b57aabbb7b6e391107ce3787ca34358
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
@@ -21,7 +21,7 @@
import java.util.Collections;
import java.util.List;

import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Form;

import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -43,8 +43,8 @@ public AccessTokenValidation validateAccessToken(MessageContext mc,
String authSchemeData)
throws OAuthServiceException {
WebClient client = WebClient.fromClient(tokenValidatorClient, true);
client.header(HttpHeaders.AUTHORIZATION, authScheme + " " + authSchemeData);
return client.get(AccessTokenValidation.class);
Form form = new Form().param("authScheme", authScheme).param("authSchemeData", authSchemeData);
return client.post(form, AccessTokenValidation.class);
}

public void setTokenValidatorClient(WebClient tokenValidatorClient) {
@@ -18,9 +18,10 @@
*/
package org.apache.cxf.rs.security.oauth2.services;

import javax.ws.rs.Consumes;
import javax.ws.rs.Encoded;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@@ -30,8 +31,9 @@

@Path("validate")
public class AccessTokenValidatorService extends AbstractAccessTokenValidator {
@GET
@POST
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public AccessTokenValidation getTokenValidationInfo(@FormParam("authScheme") String authScheme,
@Encoded @FormParam("authScheme") String authSchemeData) {
if (getMessageContext().getSecurityContext().getUserPrincipal() == null) {

0 comments on commit 39e35f4

Please sign in to comment.