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/11/09 01:24:18 UTC
svn commit: r1032793 [2/2] - in
/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/cxf/ src/main/java/org/apache/cxf/auth/
src/main/java/org/apache/cxf/...
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,52 @@
+/**
+ * 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.tokens;
+
+import org.apache.cxf.auth.oauth.provider.Client;
+
+/**
+ * @author Lukasz Moren
+ */
+public class RequestToken extends Token {
+
+ /**
+ * Temporary credentials has limited time, in seconds
+ */
+ protected String oauthVerifier;
+
+
+ public RequestToken(Client client, String tokenString,
+ String tokenSecret) {
+ this(client, tokenString, tokenSecret, null);
+ }
+
+ public RequestToken(Client client, String tokenString,
+ String tokenSecret, Long lifetime) {
+ super(client, tokenString, tokenSecret, null);
+ }
+
+ public void setOauthVerifier(String oauthVerifier) {
+ this.oauthVerifier = oauthVerifier;
+ }
+
+ public String getOauthVerifier() {
+ return oauthVerifier;
+ }
+
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/RequestToken.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,104 @@
+/**
+ * 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.tokens;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.auth.oauth.provider.Client;
+
+/**
+ * @author Lukasz Moren
+ */
+public abstract class Token {
+
+ protected String tokenString;
+ protected String tokenSecret;
+ protected long issuedAt = -1;
+ protected long lifetime = -1;
+ protected Client client;
+ protected Principal principal;
+ protected List<OAuthScope> scopes;
+
+ protected Token(Client client, String tokenString,
+ String tokenSecret, long lifetime, Principal principal) {
+ this.client = client;
+ this.tokenString = tokenString;
+ this.tokenSecret = tokenSecret;
+ this.principal = principal;
+ initTokenLifeTime(lifetime);
+ }
+
+ protected Token(Client client, String tokenString,
+ String tokenSecret, Principal principal) {
+ this(client, tokenString, tokenSecret, -1, principal);
+ }
+
+ private void initTokenLifeTime(Long lifetm) {
+ this.lifetime = lifetm;
+ issuedAt = System.currentTimeMillis() / 1000;
+ }
+
+ public Client getClient() {
+ return client;
+ }
+
+ public String getTokenString() {
+ return tokenString;
+ }
+
+ public String getTokenSecret() {
+ return tokenSecret;
+ }
+
+ public Principal getPrincipal() {
+ return principal;
+ }
+
+ public long getIssuedAt() {
+ return issuedAt;
+ }
+
+ public long getLifetime() {
+ return lifetime;
+ }
+
+ public void setPrincipal(Principal principal) {
+ this.principal = principal;
+ }
+
+ public List<OAuthScope> getScopes() {
+ return scopes;
+ }
+
+ public void setScopes(List<OAuthScope> scopes) {
+ this.scopes = scopes;
+ }
+
+ public List<String> getAuthorities() {
+ List<String> authorities = new ArrayList<String>();
+ if (scopes != null) {
+ for (OAuthScope scope : scopes) {
+ authorities.add(scope.getRole());
+ }
+ }
+ return authorities;
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/tokens/Token.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/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/oauth-core/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,190 @@
+/**
+ * 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.utils;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthMessage;
+import net.oauth.OAuthProblemException;
+
+import org.apache.cxf.auth.oauth.endpoints.AuthorizationService;
+import org.apache.cxf.auth.oauth.provider.OAuthDataProvider;
+import org.apache.cxf.auth.oauth.tokens.RequestToken;
+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
+ */
+public final class OAuthUtils {
+
+ private static final String ENCODING = "UTF-8";
+ private static final String PARAMETER_SEPARATOR = "&";
+ private static final String NAME_VALUE_SEPARATOR = "=";
+
+ private OAuthUtils() {
+ }
+
+ public static Response handleException(Exception e, int status) {
+ return handleException(e, status, null);
+ }
+
+ public static Response handleException(Exception e, int status,
+ String realm) {
+ if (e instanceof OAuthProblemException) {
+ OAuthProblemException problem = (OAuthProblemException)e;
+ OAuthMessage message = new OAuthMessage(null, null, problem
+ .getParameters().entrySet());
+ try {
+ return
+ Response.status(status).header("WWW-Authenticate", message.getAuthorizationHeader(realm))
+ .entity(e.getMessage()).build();
+ } catch (IOException e1) {
+ throw new WebApplicationException(
+ Response.status(status).entity(e.getMessage()).build());
+ }
+ }
+ throw new WebApplicationException(
+ Response.status(status).entity(e.getMessage()).build());
+ }
+
+ public static List<String> parseScopesFromRequest(OAuthMessage message) throws IOException {
+ String scopes = message.getParameter(AuthorizationService.X_OAUTH_SCOPE);
+ List<String> scopeList = new ArrayList<String>();
+
+ if (!StringUtils.isEmpty(scopes)) {
+ StringTokenizer tokenizer = new StringTokenizer(scopes, ",");
+
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ scopeList.add(token);
+ }
+ }
+ return scopeList;
+ }
+
+ /**
+ * Translates parameters into <code>application/x-www-form-urlencoded</code> String
+ *
+ * @param parameters parameters to encode
+ * @param encoding The name of a supported
+ * <a href="../lang/package-summary.html#charenc">character
+ * encoding</a>.
+ * @return Translated string
+ */
+ public static String format(
+ final Collection<? extends Map.Entry<String, String>> parameters,
+ final String encoding) {
+ final StringBuilder result = new StringBuilder();
+ for (final Map.Entry<String, String> parameter : parameters) {
+ if (!StringUtils.isEmpty(parameter.getKey())
+ && !StringUtils.isEmpty(parameter.getValue())) {
+ final String encodedName = encode(parameter.getKey(), encoding);
+ final String value = parameter.getValue();
+ final String encodedValue = value != null ? encode(value, encoding) : "";
+ if (result.length() > 0) {
+ result.append(PARAMETER_SEPARATOR);
+ }
+ result.append(encodedName);
+ result.append(NAME_VALUE_SEPARATOR);
+ result.append(encodedValue);
+ }
+ }
+ return result.toString();
+ }
+
+ private static String encode(final String content, final String encoding) {
+ try {
+ return URLEncoder.encode(content,
+ encoding != null ? encoding : "UTF-8");
+ } catch (UnsupportedEncodingException problem) {
+ throw new IllegalArgumentException(problem);
+ }
+ }
+
+ public static RequestToken handleTokenRejectedException() throws OAuthProblemException {
+ OAuthProblemException problemEx = new OAuthProblemException(
+ OAuth.Problems.TOKEN_REJECTED);
+ problemEx
+ .setParameter(OAuthProblemException.HTTP_STATUS_CODE, HttpServletResponse.SC_UNAUTHORIZED);
+ throw problemEx;
+ }
+
+ public static Object instantiateClass(String className, Class superType) throws Exception {
+ Class<?> clazz = Class.forName(className);
+ if (!superType.isAssignableFrom(clazz)) {
+ throw new Exception("You need to provide class with supertype: " + superType.getName());
+ }
+ return clazz.newInstance();
+ }
+
+ public static OAuthDataProvider getOAuthDataProviderFromServletContext(ServletContext servletContext) {
+ OAuthDataProvider dataProvider = (OAuthDataProvider)servletContext
+ .getAttribute(OAuthDataProvider.OAUTH_DATA_PROVIDER_INSTANCE_KEY);
+
+ if (dataProvider == null) {
+ String dataProviderClassName = servletContext
+ .getInitParameter(OAuthDataProvider.OAUTH_DATA_PROVIDER_CLASS);
+
+ String oauthValidatorClassName = servletContext
+ .getInitParameter(OAuthDataProvider.OAUTH_DATA_VALIDATOR_CLASS);
+
+ if (StringUtils.isEmpty(oauthValidatorClassName)) {
+ //if no validator was provided fallback to default validator
+ oauthValidatorClassName = OAuthMessageValidator.class.getName();
+ }
+
+ if (StringUtils.isEmpty(dataProviderClassName)) {
+ throw new RuntimeException(
+ "There should be provided [ " + OAuthDataProvider.OAUTH_DATA_PROVIDER_CLASS
+ + " ] context init param in web.xml");
+ }
+
+ try {
+ dataProvider = (OAuthDataProvider)OAuthUtils
+ .instantiateClass(dataProviderClassName, OAuthDataProvider.class);
+ OAuthValidator oAuthValidator = (OAuthValidator)OAuthUtils
+ .instantiateClass(oauthValidatorClassName, OAuthValidator.class);
+
+ dataProvider.setValidator(oAuthValidator);
+
+ servletContext
+ .setAttribute(OAuthDataProvider.OAUTH_DATA_PROVIDER_INSTANCE_KEY, dataProvider);
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Cannot instantiate OAuth Data Provider class: " + dataProviderClassName, e);
+ }
+ }
+
+ return dataProvider;
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/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/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,60 @@
+/**
+ * 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.OAuth;
+import net.oauth.OAuthException;
+import net.oauth.OAuthMessage;
+import net.oauth.OAuthProblemException;
+import net.oauth.SimpleOAuthValidator;
+
+import org.apache.cxf.auth.oauth.tokens.Token;
+
+
+/**
+ * @author Lukasz Moren
+ */
+public class OAuthMessageValidator extends SimpleOAuthValidator implements OAuthValidator {
+
+ public static final String VERIFIER_INVALID = "verifier_invalid";
+
+ public OAuthMessageValidator() {
+ }
+
+ public void checkParameters(OAuthMessage message) throws OAuthException, IOException, URISyntaxException {
+ super.checkSingleParameters(message);
+ }
+
+ public void validateToken(Token token) throws OAuthProblemException {
+ if (token == null) {
+ throw new OAuthProblemException(OAuth.Problems.TOKEN_REJECTED);
+ } else {
+ Long issuedAt = token.getIssuedAt();
+ Long lifetime = token.getLifetime();
+ if (lifetime != -1
+ && (issuedAt + lifetime < (System.currentTimeMillis() / 1000))) {
+ throw new OAuthProblemException(OAuth.Problems.TOKEN_EXPIRED);
+ }
+ }
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthMessageValidator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/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/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,43 @@
+/**
+ * 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;
+import net.oauth.OAuthProblemException;
+
+import org.apache.cxf.auth.oauth.tokens.Token;
+
+/**
+ * @author Lukasz Moren
+ */
+public interface OAuthValidator {
+
+ void validateMessage(OAuthMessage message, OAuthAccessor accessor)
+ throws OAuthException, IOException, URISyntaxException;
+
+ void checkParameters(OAuthMessage message)
+ throws OAuthException, IOException, URISyntaxException;
+
+ void validateToken(Token token) throws OAuthProblemException;
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/validation/OAuthValidator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,69 @@
+/**
+ * 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;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cxf.auth.oauth.provider.Client;
+import org.apache.cxf.auth.oauth.provider.ClientImpl;
+import org.apache.cxf.auth.oauth.provider.MemoryOauthDataProvider;
+import org.apache.cxf.auth.oauth.tokens.OAuthScope;
+import org.apache.cxf.auth.oauth.utils.OAuthTestUtils;
+import org.apache.cxf.common.security.SimplePrincipal;
+
+/**
+ * @author Lukasz Moren
+ */
+public class TestSampleOAuthDataProvider extends MemoryOauthDataProvider {
+
+ protected ConcurrentHashMap<String, OAuthScope> availableScopes
+ = new ConcurrentHashMap<String, OAuthScope>();
+
+ {
+ availableScopes
+ .put("read_info", new OAuthScope("read_info", "Read your personal information", "ROLE_USER"));
+ availableScopes.put("modify_info",
+ new OAuthScope("modify_info", "Modify your personal information", "ROLE_ADMIN"));
+ }
+
+ public TestSampleOAuthDataProvider() {
+ Client client = new ClientImpl(OAuthTestUtils.CLIENT_ID, OAuthTestUtils.CLIENT_SECRET,
+ OAuthTestUtils.CALLBACK, OAuthTestUtils.APPLICATION_NAME);
+ clientAuthInfo.put(OAuthTestUtils.CLIENT_ID, client);
+ }
+
+ public List<OAuthScope> getAvailableScopes(List<String> requestScopes) {
+ List<OAuthScope> scopes = new ArrayList<OAuthScope>();
+ for (String requestScope : requestScopes) {
+ OAuthScope oAuthScope = availableScopes.get(requestScope);
+ scopes.add(oAuthScope);
+ }
+
+ return scopes;
+ }
+
+ public Principal loggedPrincipal(HttpServletRequest request) {
+ return new SimplePrincipal("testUser");
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/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/oauth-core/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,120 @@
+/**
+ * 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.IOException;
+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.OAuthException;
+import net.oauth.OAuthMessage;
+import net.oauth.ParameterStyle;
+
+import org.apache.cxf.auth.oauth.server.AbstractJettyServerTest;
+import org.apache.cxf.auth.oauth.utils.OAuthTestUtils;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
+
+import org.eclipse.jetty.http.HttpHeaders;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Lukasz Moren
+ */
+public class TemporaryCredentialServiceTest extends AbstractJettyServerTest {
+
+ public static final String TEMPORARY_CREDENTIALS_URL = "/a/oauth/initiate";
+ public static final String HOST = "http://localhost:";
+
+ private static final Logger LOG = LogUtils.getL7dLogger(TemporaryCredentialServiceTest.class);
+
+ @Test
+ public void testGetTemporaryCredentialsURIQuery() 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});
+
+ 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);
+ }
+ }
+ }
+
+ protected OAuthMessage invokeRequestToken(Map<String, String> parameters, ParameterStyle style,
+ int 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/oauth-core/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,82 @@
+/**
+ * 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.server;
+
+import java.net.URISyntaxException;
+
+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;
+
+
+/**
+ * @author Lukasz Moren
+ */
+public abstract class AbstractJettyServerTest {
+
+ public static final int PORT = 9003;
+
+ private static org.eclipse.jetty.server.Server server;
+
+ protected AbstractJettyServerTest() {
+ }
+
+ @BeforeClass
+ public static void run() throws Exception {
+
+ server = new org.eclipse.jetty.server.Server();
+
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setPort(PORT);
+ server.setConnectors(new Connector[] {connector});
+
+ WebAppContext webappcontext = new WebAppContext();
+ String contextPath = null;
+ try {
+ contextPath = ExampleServlet.class.getResource("/server").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/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/AbstractJettyServerTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,29 @@
+/**
+ * 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.server;
+
+import javax.servlet.http.HttpServlet;
+
+/**
+ * @author Lukasz Moren
+ */
+public class ExampleServlet extends HttpServlet {
+
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/server/ExampleServlet.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java Tue Nov 9 00:24:17 2010
@@ -0,0 +1,108 @@
+/**
+ * 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.utils;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+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;
+
+/**
+ * @author Lukasz Moren
+ */
+public final class OAuthTestUtils {
+
+ public static final String CALLBACK = "http://www.example.com/callback";
+ public static final String APPLICATION_NAME = "Test Oauth 1.0 application";
+ 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[] SIGN_METHOD = {"HMAC-SHA1", "PLAINTEXT"};
+
+
+ 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);
+ }
+}
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/utils/OAuthTestUtils.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml Tue Nov 9 00:24:17 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-http.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
+
+
+ <jaxrs:server id="oauthServer" address="/oauth/">
+ <jaxrs:serviceBeans>
+ <ref bean="temporaryCredentialService"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="temporaryCredentialService"
+ class="org.apache.cxf.auth.oauth.endpoints.TemporaryCredentialsServiceImpl">
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml?rev=1032793&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml Tue Nov 9 00:24:17 2010
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright 2010 Newcastle University
+ Maciej Machulak, Lukasz Moren
+
+ http://research.ncl.ac.uk/smart/
+
+ Licensed 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.
+
+-->
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <context-param>
+ <param-name>oauth.data.provider-class</param-name>
+ <param-value>org.apache.cxf.auth.oauth.TestSampleOAuthDataProvider</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/*-beans.xml</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <servlet-class>
+ org.apache.cxf.transport.servlet.CXFServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/a/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/resources/server/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml