You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by lm...@apache.org on 2010/08/04 00:05:20 UTC
svn commit: r982045 [2/2] - in /cxf/sandbox/oauth_1.0a:
distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/
distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/
rt/rs/oauth/ rt/rs/oauth/src/main/...
Copied: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java (from r981471, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/AccessToken.java)
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java?p2=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java&p1=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/AccessToken.java&r1=981471&r2=982045&rev=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/AccessToken.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java Tue Aug 3 22:05:18 2010
@@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.cxf.auth.oauth.provider;
+package org.apache.cxf.auth.oauth.tokens;
+
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfo;
/**
* @author Lukasz Moren
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/AccessToken.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java (from r981471, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/RequestToken.java)
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java?p2=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java&p1=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/RequestToken.java&r1=981471&r2=982045&rev=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/RequestToken.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java Tue Aug 3 22:05:18 2010
@@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.cxf.auth.oauth.provider;
+package org.apache.cxf.auth.oauth.tokens;
+
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfo;
/**
* @author Lukasz Moren
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java (from r981471, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/Token.java)
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java?p2=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java&p1=cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/Token.java&r1=981471&r2=982045&rev=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/Token.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java Tue Aug 3 22:05:18 2010
@@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.cxf.auth.oauth.provider;
+package org.apache.cxf.auth.oauth.tokens;
+
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfo;
/**
* @author Lukasz Moren
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java?rev=982045&r1=982044&r2=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java Tue Aug 3 22:05:18 2010
@@ -19,15 +19,30 @@
package org.apache.cxf.auth.oauth.utils;
import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Map;
import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
+import net.oauth.OAuthException;
import net.oauth.OAuthMessage;
import net.oauth.OAuthProblemException;
import net.oauth.server.OAuthServlet;
+import org.apache.cxf.auth.oauth.handlers.DefaultOAuthRequestHandler;
+import org.apache.cxf.auth.oauth.handlers.OAuthRequestHandler;
+import org.apache.cxf.auth.oauth.provider.MemoryOauthDataProvider;
+import org.apache.cxf.auth.oauth.provider.OAuthDataProvider;
+import org.apache.cxf.auth.oauth.validation.OAuthMessageValidator;
+import org.apache.cxf.auth.oauth.validation.OAuthValidator;
+import org.apache.cxf.common.util.StringUtils;
+
/**
* @author Lukasz Moren
*/
@@ -83,4 +98,99 @@ public final class OAuthUtils {
public static void handleException(HttpServletResponse response, Exception e, int status) {
handleException(response, e, status, null, true);
}
+
+ public static Object createObjectFromClassName(String className)
+ throws IllegalAccessException, InstantiationException, ClassNotFoundException {
+ Class<?> clazz = Class.forName(className);
+ return clazz.newInstance();
+ }
+
+ public static Object createServletObjectFromClassName(String className, Logger log)
+ throws ServletException {
+ try {
+ return createObjectFromClassName(className);
+ } catch (IllegalAccessException e) {
+ log.log(Level.SEVERE, "Cannot create OAuth object: ", e);
+ throw new ServletException(e);
+ } catch (InstantiationException e) {
+ log.log(Level.SEVERE, "Cannot create OAuth object: ", e);
+ throw new ServletException(e);
+ } catch (ClassNotFoundException e) {
+ log.log(Level.SEVERE, "Cannot create OAuth object: ", e);
+ throw new ServletException(e);
+ }
+ }
+
+ public static OAuthRequestHandler initiateServletContext(ServletContext context, Logger log)
+ throws ServletException {
+ OAuthRequestHandler requestHandler = (OAuthRequestHandler)context
+ .getAttribute(OAuthRequestHandler.OAUTH_REQUEST_HANDLER);
+
+ if (requestHandler != null) {
+ return requestHandler;
+ }
+
+ requestHandler = (OAuthRequestHandler)loadObject(context,
+ OAuthRequestHandler.OAUTH_REQUEST_HANDLER_CLASS_NAME,
+ DefaultOAuthRequestHandler.class, log);
+
+ OAuthDataProvider dataProvider = (OAuthDataProvider)loadObject(context,
+ OAuthDataProvider.OAUTH_DATA_PROVIDER_CLASS_NAME,
+ MemoryOauthDataProvider.class, log);
+
+ OAuthValidator validator = (OAuthValidator)loadObject(context,
+ OAuthValidator.OAUTH_VALIDATOR_CLASS_NAME,
+ OAuthMessageValidator.class, log);
+
+
+ // set the provider and validator
+ requestHandler.setOAuthDataProvider(dataProvider);
+ requestHandler.setOAuthValidator(validator);
+ context.setAttribute(OAuthRequestHandler.OAUTH_REQUEST_HANDLER, requestHandler);
+
+ return requestHandler;
+ }
+
+ public static Object loadObject(ServletContext context, String classParamName, Class fallbackClass,
+ Logger log)
+ throws ServletException {
+ Object ob;
+
+ String reqHandlerclassName = context.getInitParameter(classParamName);
+
+ if (StringUtils.isEmpty(reqHandlerclassName)) {
+ log.log(Level.INFO,
+ "No {0} provided in servlet context. Initiating default object: {1}",
+ new String[] {classParamName,
+ fallbackClass.getName()});
+ ob = createServletObjectFromClassName(fallbackClass.getName(), log);
+ } else {
+ ob = OAuthUtils.createServletObjectFromClassName(reqHandlerclassName, log);
+ log.log(Level.INFO,
+ "Created {0} OAuth object: {1}", new String[] {classParamName, ob.getClass().getName()});
+ }
+
+ return ob;
+ }
+
+ public static void prepareHttpServletResponse(HttpServletResponse response, Object entity,
+ int responseCode, String contentType)
+ throws IOException, OAuthException {
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType(contentType);
+ response.setStatus(responseCode);
+
+ PrintWriter pw = response.getWriter();
+ pw.write(entity.toString());
+ pw.flush();
+ }
+
+ public static void prepareHttpServletResponse(HttpServletResponse response, int responseCode,
+ Map<String, String> headers) {
+ response.setStatus(responseCode);
+ for (Map.Entry<String, String> header : headers.entrySet()) {
+ response.setHeader(header.getKey(), header.getValue());
+ }
+
+ }
}
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java?rev=982045&r1=982044&r2=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java Tue Aug 3 22:05:18 2010
@@ -20,6 +20,7 @@
package org.apache.cxf.auth.oauth.validation;
import java.io.IOException;
+import java.net.URISyntaxException;
import net.oauth.OAuthException;
import net.oauth.OAuthMessage;
@@ -29,14 +30,14 @@ import net.oauth.SimpleOAuthValidator;
/**
* @author Lukasz Moren
*/
-public class OAuthMessageValidator extends SimpleOAuthValidator {
+public class OAuthMessageValidator extends SimpleOAuthValidator implements OAuthValidator {
public static final String VERIFIER_INVALID = "verifier_invalid";
public OAuthMessageValidator() {
}
- public void validateSingleParameters(OAuthMessage message) throws IOException, OAuthException {
+ public void checkParameters(OAuthMessage message) throws OAuthException, IOException, URISyntaxException {
super.checkSingleParameters(message);
}
}
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java Tue Aug 3 22:05:18 2010
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.validation;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import net.oauth.OAuthAccessor;
+import net.oauth.OAuthException;
+import net.oauth.OAuthMessage;
+
+/**
+ * @author Lukasz Moren
+ */
+public interface OAuthValidator {
+ String OAUTH_VALIDATOR_CLASS_NAME = "oAuthValidatorClassName";
+
+ void validateMessage(OAuthMessage message, OAuthAccessor accessor)
+ throws OAuthException, IOException, URISyntaxException;
+
+ void checkParameters(OAuthMessage message)
+ throws OAuthException, IOException, URISyntaxException;
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/JUnit4SpringContextTests.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/JUnit4SpringContextTests.java?rev=982045&r1=982044&r2=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/JUnit4SpringContextTests.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/JUnit4SpringContextTests.java Tue Aug 3 22:05:18 2010
@@ -20,7 +20,7 @@
package org.apache.cxf.auth.oauth.endpoints;
import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
@@ -29,10 +29,10 @@ import org.springframework.context.suppo
public abstract class JUnit4SpringContextTests extends Assert {
- protected ClassPathXmlApplicationContext ctx;
+ protected static ClassPathXmlApplicationContext ctx;
- @Before
- public void initialize() {
+ @BeforeClass
+ public static void initialize() {
String[] locations = {"classpath:oauth-beans.xml"};
ctx = new ClassPathXmlApplicationContext(locations);
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java Tue Aug 3 22:05:18 2010
@@ -0,0 +1,182 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.endpoints;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthAccessor;
+import net.oauth.OAuthConsumer;
+import net.oauth.OAuthException;
+import net.oauth.OAuthMessage;
+import net.oauth.ParameterStyle;
+import net.oauth.client.OAuthClient;
+import net.oauth.client.URLConnectionClient;
+
+import org.apache.cxf.common.util.StringUtils;
+
+import org.eclipse.jetty.http.HttpHeaders;
+import org.junit.Assert;
+
+/**
+ * @author Lukasz Moren
+ */
+public final class OAuthTestUtils {
+
+ public static final String CALLBACK = "http://www.printer.example.com/ready/callback";
+ public static final String CLIENT_ID = "12345678";
+ public static final String CLIENT_SECRET = "secret";
+ public static final String CLIENT_SHARED_SECRET = "shared_secret";
+ public static final String HOST = "http://localhost:";
+ public static final String[] SIGN_METHOD = {"HMAC-SHA1", "PLAINTEXT"};
+ public static final String TEMPORARY_CREDENTIALS_URL = "/auth/oauth/initiate";
+
+ private OAuthTestUtils() {
+ }
+
+ public static OAuthMessage access(String url, String method, Map<String, String> params,
+ ParameterStyle style)
+ throws IOException, URISyntaxException, OAuthException {
+
+ OAuthConsumer consumer = new OAuthConsumer(null, params.get(OAuth.OAUTH_CONSUMER_KEY),
+ params.get(CLIENT_SHARED_SECRET), null);
+
+ OAuthAccessor accessor = new OAuthAccessor(consumer);
+
+ OAuthMessage msg = accessor
+ .newRequestMessage(method, url, params.entrySet());
+
+ OAuthClient client = new OAuthClient(new URLConnectionClient());
+
+ return client.access(msg, style);
+ }
+
+ public static String readBody(OAuthMessage msg) throws IOException {
+ StringBuffer body = new StringBuffer();
+ InputStream responseBody = null;
+ BufferedReader br = null;
+ try {
+ responseBody = msg.getBodyAsStream();
+ if (responseBody != null) {
+ br = new BufferedReader(new InputStreamReader(responseBody));
+ String buf;
+ while ((buf = br.readLine()) != null) {
+ body.append(buf);
+ }
+ }
+ } finally {
+ if (br != null) {
+ br.close();
+ }
+ if (responseBody != null) {
+ responseBody.close();
+ }
+ }
+ return body.toString().trim();
+ }
+
+ public static OAuth.Parameter findOAuthParameter(List<OAuth.Parameter> list, String key) {
+ for (OAuth.Parameter parameter : list) {
+ if (key.equals(parameter.getKey())) {
+ return parameter;
+ }
+ }
+ return null;
+ }
+
+ public static List<OAuth.Parameter> getResponseParams(OAuthMessage message) throws IOException {
+ String body = OAuthTestUtils.readBody(message);
+ return OAuth.decodeForm(body);
+ }
+
+ public static void testHandleTemporaryCredentialsRequest(Logger log, String port) throws Exception {
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put(OAuth.OAUTH_CALLBACK, OAuthTestUtils.CALLBACK);
+ parameters.put(OAuthTestUtils.CLIENT_SHARED_SECRET, OAuthTestUtils.CLIENT_SECRET);
+
+ //check all parameter transimssions
+ for (ParameterStyle style : ParameterStyle.values()) {
+ //for all signing methods
+ for (String signMethod : OAuthTestUtils.SIGN_METHOD) {
+ log.log(Level.INFO, "Preapring request with parameter style: {0} and signature method: {1}",
+ new String[] {style.toString(), signMethod.toString()});
+
+ parameters.put(OAuth.OAUTH_SIGNATURE_METHOD, signMethod);
+ parameters.put(OAuth.OAUTH_NONCE, UUID.randomUUID().toString());
+ parameters.put(OAuth.OAUTH_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
+ parameters.put(OAuth.OAUTH_CONSUMER_KEY, OAuthTestUtils.CLIENT_ID);
+ OAuthMessage message = invokeRequestToken(parameters, style, port);
+
+ //test response ok
+ boolean isFormEncoded = OAuth.isFormEncoded(message.getBodyType());
+ Assert.assertTrue(isFormEncoded);
+
+ List<OAuth.Parameter> responseParams = OAuthTestUtils.getResponseParams(message);
+
+ String wwwHeader = message.getHeader(HttpHeaders.WWW_AUTHENTICATE);
+ Assert.assertNull(wwwHeader);
+
+ String callbacConf = OAuthTestUtils
+ .findOAuthParameter(responseParams, OAuth.OAUTH_CALLBACK_CONFIRMED)
+ .getValue();
+ Assert.assertEquals("true", callbacConf);
+
+ String oauthToken = OAuthTestUtils.findOAuthParameter(responseParams, OAuth.OAUTH_TOKEN)
+ .getKey();
+ Assert.assertFalse(StringUtils.isEmpty(oauthToken));
+
+ String tokenSecret = OAuthTestUtils
+ .findOAuthParameter(responseParams, OAuth.OAUTH_TOKEN_SECRET)
+ .getKey();
+ Assert.assertFalse(StringUtils.isEmpty(tokenSecret));
+
+
+ //test wrong client id
+ parameters.put(OAuth.OAUTH_CONSUMER_KEY, "wrong");
+ message = invokeRequestToken(parameters, style, port);
+
+ wwwHeader = message.getHeader(HttpHeaders.WWW_AUTHENTICATE);
+ List<OAuth.Parameter> list = OAuthMessage.decodeAuthorization(wwwHeader);
+
+ String oauthProblem = OAuthTestUtils.findOAuthParameter(list, "oauth_problem").getValue();
+ Assert.assertEquals(OAuth.Problems.CONSUMER_KEY_UNKNOWN, oauthProblem);
+ }
+ }
+ }
+
+ public static OAuthMessage invokeRequestToken(Map<String, String> parameters, ParameterStyle style,
+ String port)
+ throws IOException, URISyntaxException, OAuthException {
+ OAuthMessage message;
+ String uri = HOST + port + TEMPORARY_CREDENTIALS_URL;
+ message = OAuthTestUtils
+ .access(uri, OAuthMessage.POST, parameters, style);
+ return message;
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthTestUtils.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java?rev=982045&r1=982044&r2=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java Tue Aug 3 22:05:18 2010
@@ -18,23 +18,14 @@
*/
package org.apache.cxf.auth.oauth.endpoints;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.util.UUID;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-
-import net.oauth.OAuth;
-import net.oauth.OAuthProblemException;
+import java.util.logging.Logger;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -42,103 +33,25 @@ import org.junit.Test;
*/
public class TemporaryCredentialServiceTest extends JUnit4SpringContextTests {
- static final String TEMPORARY_CREDENTIALS_URL = "http://localhost:9000/auth/oauth/initiate";
- Server s;
-
- @Test
- public void testGetTemporaryCredentialsURIQuery() throws Exception {
-
- //test request uri query
- URI uri = UriBuilder.fromUri(new URI(TEMPORARY_CREDENTIALS_URL))
- .queryParam("oauth_consumer_key", 12345678).queryParam("oauth_signature_method", "PLAINTEXT")
- .queryParam("oauth_callback", "http%3A%2F%2Fprinter.example.com%2Fready")
- .queryParam("oauth_signature", "secret%26").queryParam("oauth_nonce", UUID.randomUUID())
- .queryParam("oauth_timestamp", String.valueOf(System.currentTimeMillis() / 1000))
- .buildFromEncoded();
-
- WebClient cl = WebClient.create(uri);
- cl.accept("application/x-www-form-urlencoded");
- Response r = cl.post(null);
+ private static final Logger LOG = LogUtils.getL7dLogger(TemporaryCredentialsServiceImpl.class);
- validateOAuthMessage(r);
+ private static Server s;
- }
-
- @Test
- public void invokeTemporaryCredentialsBody() throws Exception {
- //test request uri query
- URI uri = UriBuilder.fromUri(new URI(TEMPORARY_CREDENTIALS_URL))
- .buildFromEncoded();
-
- String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
- StringBuilder formEncodedBody = new StringBuilder(OAuth.OAUTH_CONSUMER_KEY)
- .append("=12345678&").append(OAuth.OAUTH_SIGNATURE_METHOD)
- .append("=PLAINTEXT&").append(OAuth.OAUTH_SIGNATURE)
- .append("=secret%26&")
- .append(OAuth.OAUTH_NONCE).append("=").append(UUID.randomUUID()).append("&")
- .append(OAuth.OAUTH_TIMESTAMP).append("=").append(timestamp)
- .append("&").append(OAuth.OAUTH_CALLBACK)
- .append("=http%3A%2F%2Fprinter.example.com%2Fready");
-
- WebClient cl = WebClient.create(uri);
- cl.accept("application/x-www-form-urlencoded");
-
-
-// Response r = cl.post(formEncodedBody.toString());
-// assertEquals(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, r.getStatus());
-
- cl.header("Content-Type", OAuth.FORM_ENCODED);
- Response r = cl.post(formEncodedBody.toString());
- validateOAuthMessage(r);
- }
@Test
- public void testGetTemporaryCredentialsAuthHeader() throws Exception {
-
-
- //test request uri query
- URI uri = UriBuilder.fromUri(new URI(TEMPORARY_CREDENTIALS_URL))
- .buildFromEncoded();
-
- WebClient cl = WebClient.create(uri);
- cl.accept("application/x-www-form-urlencoded");
-
- String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
- StringBuilder authHeader = new StringBuilder("OAuth realm=\"Example\",")
- .append(OAuth.OAUTH_CONSUMER_KEY).append("=\"12345678\",")
- .append(OAuth.OAUTH_SIGNATURE_METHOD).append("=\"PLAINTEXT\",")
- .append(OAuth.OAUTH_SIGNATURE).append("=\"secret%26\",")
- .append(OAuth.OAUTH_NONCE).append("=\"").append(UUID.randomUUID()).append("\",")
- .append(OAuth.OAUTH_TIMESTAMP).append("=\"").append(timestamp)
- .append("\",").append(OAuth.OAUTH_CALLBACK)
- .append("=\"http%3A%2F%2Fprinter.example.com%2Fready\"");
-
- cl.header("Authorization", authHeader.toString());
- Response r = cl.post(null);
-
- validateOAuthMessage(r);
- }
-
- private void validateOAuthMessage(Response r) throws IOException, OAuthProblemException {
- OAuthResponseMessage message = new OAuthResponseMessage(null, null, null,
- (InputStream)r.getEntity());
- message.completeParameters();
- message.requireParameters(OAuth.OAUTH_CALLBACK_CONFIRMED, OAuth.OAUTH_TOKEN,
- OAuth.OAUTH_TOKEN_SECRET);
-
- assertEquals(3, message.getParameters().size());
- assertEquals(HttpServletResponse.SC_OK, r.getStatus());
+ public void testGetTemporaryCredentialsURIQuery() throws Exception {
+ OAuthTestUtils.testHandleTemporaryCredentialsRequest(LOG, "9000");
}
- @Before
- public void initService() throws Exception {
+ @BeforeClass
+ public static void initService() throws Exception {
JAXRSServerFactoryBean sf = (JAXRSServerFactoryBean)ctx.getBean("oauthServer");
s = sf.create();
}
- @After
- public void stopService() throws Exception {
+ @AfterClass
+ public static void stopService() throws Exception {
if (s != null) {
s.destroy();
}
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java Tue Aug 3 22:05:18 2010
@@ -0,0 +1,93 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.servlets;
+
+import java.net.URISyntaxException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.auth.oauth.endpoints.OAuthTestUtils;
+import org.apache.cxf.auth.oauth.endpoints.TemporaryCredentialsServiceImpl;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.testutil.common.TestUtil;
+
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.handler.DefaultHandler;
+import org.eclipse.jetty.server.handler.HandlerCollection;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.webapp.WebAppContext;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Lukasz Moren
+ */
+public class ServletsTest {
+ public static final String PORT = TestUtil.getPortNumber(ServletsTest.class);
+ private static org.eclipse.jetty.server.Server server;
+
+ private static final Logger LOG = LogUtils.getL7dLogger(TemporaryCredentialsServiceImpl.class);
+
+ @Test
+ public void temporaryCredentialsServletTest() throws Exception {
+ OAuthTestUtils.testHandleTemporaryCredentialsRequest(LOG, PORT);
+ }
+
+
+ @BeforeClass
+ public static void run() throws Exception {
+ LOG.setLevel(Level.INFO);
+ System.out.println("Starting Server");
+
+ server = new org.eclipse.jetty.server.Server();
+
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setPort(Integer.parseInt(PORT));
+ server.setConnectors(new Connector[] {connector});
+
+ WebAppContext webappcontext = new WebAppContext();
+ String contextPath = null;
+ try {
+ contextPath = ServletsTest.class.getResource("/servlet").toURI().getPath();
+ } catch (URISyntaxException e1) {
+ e1.printStackTrace();
+ }
+ webappcontext.setContextPath("/");
+
+ webappcontext.setWar(contextPath);
+
+ HandlerCollection handlers = new HandlerCollection();
+ handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});
+
+ server.setHandler(handlers);
+ server.start();
+ }
+
+ @AfterClass
+ public static void stop() throws Exception {
+
+ if (server != null) {
+ server.stop();
+ server.destroy();
+ server = null;
+ }
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/ServletsTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java Tue Aug 3 22:05:18 2010
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.servlets;
+
+import org.junit.Test;
+
+/**
+ * @author Lukasz Moren
+ */
+public class TemporaryCredentialsServletTest {
+ @Test
+ public void testInit() throws Exception {
+
+ }
+
+ @Test
+ public void doPost() throws Exception {
+ // strict mock forces you to specify the correct order of method calls
+// HttpServletRequest request = createStrictMock(HttpServletRequest.class);
+//// HttpServletResponse response = createStrictMock(HttpServletResponse.class);
+//
+// expect(request.getParameter("firstName")).andReturn("phil");
+// expect(request.getParameter("lastName")).andReturn("zoio");
+//
+// request.setAttribute("firstName", "phil");
+// request.setAttribute("lastName", "zoio");
+//
+// expect(request.getRequestDispatcher("/hello.jsp")).
+// andReturn(createMock(RequestDispatcher.class));
+//
+// //unexpected method calls after this point will throw exceptions
+// replay(request);
+// //todo check that
+//// new TemporaryCredentialsServlet().doPost(request, response);
+//
+// //check that the behaviour expected is actually
+// verify(request);
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TemporaryCredentialsServletTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java Tue Aug 3 22:05:18 2010
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.servlets;
+
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfoImpl;
+import org.apache.cxf.auth.oauth.provider.MemoryOauthDataProvider;
+
+/**
+ * @author Lukasz Moren
+ */
+public class TestMemoryOAuthDataProvider extends MemoryOauthDataProvider {
+
+ public TestMemoryOAuthDataProvider() {
+ super();
+ ClientAuthNInfoImpl client = new ClientAuthNInfoImpl("12345678", "secret",
+ "http://www.example.com/callback");
+ clientAuthInfo.putIfAbsent("12345678", client);
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/servlets/TestMemoryOAuthDataProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/oauth-beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/oauth-beans.xml?rev=982045&r1=982044&r2=982045&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/oauth-beans.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/oauth-beans.xml Tue Aug 3 22:05:18 2010
@@ -51,15 +51,22 @@ under the License.
<bean id="resourceOwnerAuthorizationEndpoint"
class="org.apache.cxf.auth.oauth.endpoints.AuthorizationServiceImpl">
- <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+ <property name="handler" ref="requestHandler"/>
</bean>
+ <bean id="requestHandler" class="org.apache.cxf.auth.oauth.handlers.DefaultOAuthRequestHandler">
+ <property name="OAuthValidator" ref="validator"/>
+ <property name="OAuthDataProvider" ref="oauthDataProvider"/>
+ </bean>
+
+ <bean id="validator" class="org.apache.cxf.auth.oauth.validation.OAuthMessageValidator"/>
+
<bean id="temporaryCredentialService"
- class="org.apache.cxf.auth.oauth.endpoints.TemporaryCredentialServiceImpl">
- <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+ class="org.apache.cxf.auth.oauth.endpoints.TemporaryCredentialsServiceImpl">
+ <property name="handler" ref="requestHandler"/>
</bean>
- <bean id="oauthDataProvider" class="org.apache.cxf.auth.oauth.provider.OAuthDataProviderImpl">
+ <bean id="oauthDataProvider" class="org.apache.cxf.auth.oauth.provider.MemoryOauthDataProvider">
<property name="clientAuthInfo">
<map key-type="java.lang.String"
value-type="org.apache.cxf.auth.oauth.provider.ClientAuthNInfo">
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml?rev=982045&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml Tue Aug 3 22:05:18 2010
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- START SNIPPET: webxml -->
+<web-app>
+ <!--start oauth params; this configuration is not necessary if you want to use default OAuth classes,
+ just wanted to show how you perform custom configuration-->
+ <context-param>
+ <param-name>oauthRequestHandlerClassName</param-name>
+ <param-value>org.apache.cxf.auth.oauth.handlers.DefaultOAuthRequestHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>oauthDataProviderClassName</param-name>
+ <param-value>org.apache.cxf.auth.oauth.servlets.TestMemoryOAuthDataProvider</param-value>
+ </context-param>
+ <context-param>
+ <param-name>oAuthValidatorClassName</param-name>
+ <param-value>org.apache.cxf.auth.oauth.validation.OAuthMessageValidator</param-value>
+ </context-param>
+ <!--end init params-->
+
+ <servlet>
+ <servlet-name>TemporaryCredentials</servlet-name>
+ <servlet-class>
+ org.apache.cxf.auth.oauth.servlets.TemporaryCredentialsServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>AuthorizationServlet</servlet-name>
+ <servlet-class>
+ org.apache.cxf.auth.oauth.servlets.TemporaryCredentialsServlet
+ </servlet-class>
+
+ <init-param>
+ <param-name>oAuthCredentialsPage</param-name>
+ <param-value>oAuthLogin.jsp</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet>
+ <servlet-name>ConfirmationService</servlet-name>
+ <servlet-class>
+ org.apache.cxf.auth.oauth.servlets.ConfirmationServlet
+ </servlet-class>
+ </servlet>
+
+
+ <servlet>
+ <servlet-name>AccessTokenServlet</servlet-name>
+ <servlet-class>
+ org.apache.cxf.auth.oauth.servlets.AccessTokenServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TemporaryCredentials</servlet-name>
+ <url-pattern>/auth/oauth/initiate</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AuthorizationServlet</servlet-name>
+ <url-pattern>/auth/oauth/authorize</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>ConfirmationService</servlet-name>
+ <url-pattern>/auth/oauth/confirm</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AccessTokenServlet</servlet-name>
+ <url-pattern>/auth/oauth/token</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+ <!-- END SNIPPET: webxml -->
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/servlet/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml