You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oltu.apache.org by to...@apache.org on 2010/12/18 18:02:44 UTC
svn commit: r1050671 [2/2] - in
/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests: ./ src/
src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/
src/test/java/org/apache/amber/ src/test/java/org/apache/amber/oauth2/
src/test/jav...
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceBodyEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceBodyEndpoint.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceBodyEndpoint.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceBodyEndpoint.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,158 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.endpoints;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.amber.oauth2.common.OAuth;
+import org.apache.amber.oauth2.common.error.OAuthError;
+import org.apache.amber.oauth2.common.exception.OAuthProblemException;
+import org.apache.amber.oauth2.common.message.types.ParameterStyle;
+import org.apache.amber.oauth2.common.utils.OAuthUtils;
+import org.apache.amber.oauth2.integration.Common;
+import org.apache.amber.oauth2.common.message.OAuthResponse;
+import org.apache.amber.oauth2.rs.response.OAuthRSResponse;
+import org.apache.amber.oauth2.rs.request.OAuthAccessResourceRequest;
+import org.apache.amber.oauth2.common.exception.OAuthSystemException;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+@Path("/resource_body")
+public class ResourceBodyEndpoint {
+
+ @POST
+ @Consumes("application/x-www-form-urlencoded")
+ @Produces("text/html")
+ public Response get(@Context HttpServletRequest request) throws OAuthSystemException {
+
+ try {
+
+ // Make the OAuth Request out of this request and validate it
+ OAuthAccessResourceRequest oauthRequest = new OAuthAccessResourceRequest(request,
+ ParameterStyle.BODY);
+
+ // Get the access token
+ String accessToken = oauthRequest.getAccessToken();
+
+ // Check if the token is valid
+ if (Common.ACCESS_TOKEN_VALID.equals(accessToken)) {
+
+ // Return the resource
+ return Response.status(Response.Status.OK).entity(accessToken).build();
+
+ }
+
+
+ // Check if the token is not expired
+ if (Common.ACCESS_TOKEN_EXPIRED.equals(accessToken)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(OAuthError.ResourceResponse.EXPIRED_TOKEN)
+ .buildHeaderMessage();
+
+ // Return the error message
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+
+
+ // Check if the token is sufficient
+ if (Common.ACCESS_TOKEN_INSUFFICIENT.equals(accessToken)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_FORBIDDEN)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(OAuthError.ResourceResponse.INSUFFICIENT_SCOPE)
+ .buildHeaderMessage();
+
+ // Return the error message
+ return Response.status(Response.Status.FORBIDDEN)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(OAuthError.ResourceResponse.INVALID_TOKEN)
+ .buildHeaderMessage();
+
+ //return Response.status(Response.Status.UNAUTHORIZED).build();
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+
+ } catch (OAuthProblemException e) {
+
+ // Check if the error code has been set
+ String errorCode = e.getError();
+ if (OAuthUtils.isEmpty(errorCode)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .buildHeaderMessage();
+
+ // If no error code then return a standard 401 Unauthorized response
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(e.getError())
+ .setErrorDescription(e.getDescription())
+ .setErrorUri(e.getUri())
+ .buildHeaderMessage();
+
+ return Response.status(oauthResponse.getResponseStatus())
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+ }
+
+}
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceBodyEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceHeaderEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceHeaderEndpoint.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceHeaderEndpoint.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceHeaderEndpoint.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,120 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.endpoints;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.amber.oauth2.common.OAuth;
+import org.apache.amber.oauth2.common.error.OAuthError;
+import org.apache.amber.oauth2.common.exception.OAuthProblemException;
+import org.apache.amber.oauth2.common.message.OAuthResponse;
+import org.apache.amber.oauth2.common.message.types.ParameterStyle;
+import org.apache.amber.oauth2.common.utils.OAuthUtils;
+import org.apache.amber.oauth2.integration.Common;
+import org.apache.amber.oauth2.rs.request.OAuthAccessResourceRequest;
+import org.apache.amber.oauth2.rs.response.OAuthRSResponse;
+import org.apache.amber.oauth2.common.exception.OAuthSystemException;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+@Path("/resource_header")
+public class ResourceHeaderEndpoint {
+
+ @GET
+ @Produces("text/html")
+ public Response get(@Context HttpServletRequest request) throws OAuthSystemException {
+
+ try {
+
+ // Make the OAuth Request out of this request
+ OAuthAccessResourceRequest oauthRequest = new OAuthAccessResourceRequest(request,
+ ParameterStyle.HEADER);
+
+ // Get the access token
+ String accessToken = oauthRequest.getAccessToken();
+
+ // Validate the access token
+ if (!Common.ACCESS_TOKEN_VALID.equals(accessToken)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(OAuthError.ResourceResponse.INVALID_TOKEN)
+ .buildHeaderMessage();
+
+ //return Response.status(Response.Status.UNAUTHORIZED).build();
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+
+ }
+
+ // Return the resource
+ return Response.status(Response.Status.OK).entity(accessToken).build();
+
+ } catch (OAuthProblemException e) {
+ // Check if the error code has been set
+ String errorCode = e.getError();
+ if (OAuthUtils.isEmpty(errorCode)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .buildHeaderMessage();
+
+ // If no error code then return a standard 401 Unauthorized response
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(e.getError())
+ .setErrorDescription(e.getDescription())
+ .setErrorUri(e.getDescription())
+ .buildHeaderMessage();
+
+ return Response.status(Response.Status.BAD_REQUEST)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+ }
+
+}
+
+
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceHeaderEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceQueryEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceQueryEndpoint.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceQueryEndpoint.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceQueryEndpoint.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,118 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.endpoints;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.amber.oauth2.common.OAuth;
+import org.apache.amber.oauth2.common.exception.OAuthProblemException;
+import org.apache.amber.oauth2.common.exception.OAuthSystemException;
+import org.apache.amber.oauth2.common.message.OAuthResponse;
+import org.apache.amber.oauth2.common.message.types.ParameterStyle;
+import org.apache.amber.oauth2.common.utils.OAuthUtils;
+import org.apache.amber.oauth2.integration.Common;
+import org.apache.amber.oauth2.rs.request.OAuthAccessResourceRequest;
+import org.apache.amber.oauth2.rs.response.OAuthRSResponse;
+import org.apache.amber.oauth2.common.error.OAuthError;
+
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+@Path("/resource_query")
+public class ResourceQueryEndpoint {
+
+ @GET
+ @Produces("text/html")
+ public Response get(@Context HttpServletRequest request) throws OAuthSystemException {
+
+ try {
+
+ // Make the OAuth Request out of this request
+ OAuthAccessResourceRequest oauthRequest = new OAuthAccessResourceRequest(request,
+ ParameterStyle.QUERY);
+
+ // Get the access token
+ String accessToken = oauthRequest.getAccessToken();
+
+ // Validate the access token
+ if (!Common.ACCESS_TOKEN_VALID.equals(accessToken)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(OAuthError.ResourceResponse.INVALID_TOKEN)
+ .buildHeaderMessage();
+
+ //return Response.status(Response.Status.UNAUTHORIZED).build();
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+
+ }
+
+ // Return the resource
+ return Response.status(Response.Status.OK).entity(accessToken).build();
+
+ } catch (OAuthProblemException e) {
+ // Check if the error code has been set
+ String errorCode = e.getError();
+ if (OAuthUtils.isEmpty(errorCode)) {
+
+ // Return the OAuth error message
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_UNAUTHORIZED)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .buildHeaderMessage();
+
+ // If no error code then return a standard 401 Unauthorized response
+ return Response.status(Response.Status.UNAUTHORIZED)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+
+ OAuthResponse oauthResponse = OAuthRSResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setRealm(Common.RESOURCE_SERVER_NAME)
+ .setError(e.getError())
+ .setErrorDescription(e.getDescription())
+ .setErrorUri(e.getUri())
+ .buildHeaderMessage();
+
+ return Response.status(Response.Status.BAD_REQUEST)
+ .header(OAuth.HeaderType.WWW_AUTHENTICATE,
+ oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE))
+ .build();
+ }
+ }
+}
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/ResourceQueryEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/TokenEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/TokenEndpoint.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/TokenEndpoint.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/TokenEndpoint.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,135 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.endpoints;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.amber.oauth2.as.issuer.MD5Generator;
+import org.apache.amber.oauth2.as.issuer.OAuthIssuerImpl;
+import org.apache.amber.oauth2.as.issuer.OAuthIssuer;
+import org.apache.amber.oauth2.as.request.OAuthTokenRequest;
+import org.apache.amber.oauth2.as.response.OAuthASResponse;
+import org.apache.amber.oauth2.common.OAuth;
+import org.apache.amber.oauth2.common.error.OAuthError;
+import org.apache.amber.oauth2.common.exception.OAuthProblemException;
+import org.apache.amber.oauth2.common.exception.OAuthSystemException;
+import org.apache.amber.oauth2.common.message.OAuthResponse;
+import org.apache.amber.oauth2.common.message.types.GrantType;
+import org.apache.amber.oauth2.integration.Common;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+@Path("/token")
+public class TokenEndpoint {
+
+ @POST
+ @Consumes("application/x-www-form-urlencoded")
+ @Produces("application/json")
+ public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException {
+
+ OAuthTokenRequest oauthRequest = null;
+
+ OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());
+
+ try {
+ oauthRequest = new OAuthTokenRequest(request);
+
+ //check if clientid is valid
+ if (!GrantType.ASSERTION.toString().equals(oauthRequest.getGrantType())) {
+ if (!Common.CLIENT_ID.equals(oauthRequest.getParam(OAuth.OAUTH_CLIENT_ID))) {
+ OAuthResponse response = OAuthASResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setError(OAuthError.TokenResponse.INVALID_CLIENT)
+ .setErrorDescription("client_id not found")
+ .buildJSONMessage();
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ }
+ }
+
+ //do checking for different grant types
+ if (oauthRequest.getParam(OAuth.OAUTH_GRANT_TYPE)
+ .equals(GrantType.AUTHORIZATION_CODE.toString())) {
+ if (!Common.AUTHORIZATION_CODE.equals(oauthRequest.getParam(OAuth.OAUTH_CODE))) {
+ OAuthResponse response = OAuthASResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setError(OAuthError.TokenResponse.INVALID_GRANT)
+ .setErrorDescription("invalid authorization code")
+ .buildJSONMessage();
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ }
+ } else if (oauthRequest.getParam(OAuth.OAUTH_GRANT_TYPE)
+ .equals(GrantType.PASSWORD.toString())) {
+ if (!Common.PASSWORD.equals(oauthRequest.getPassword())
+ || !Common.USERNAME.equals(oauthRequest.getUsername())) {
+ OAuthResponse response = OAuthASResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setError(OAuthError.TokenResponse.INVALID_GRANT)
+ .setErrorDescription("invalid username or password")
+ .buildJSONMessage();
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ }
+ } else if (oauthRequest.getParam(OAuth.OAUTH_GRANT_TYPE)
+ .equals(GrantType.ASSERTION.toString())) {
+ if (!Common.ASSERTION.equals(oauthRequest.getAssertion())) {
+ OAuthResponse response = OAuthASResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setError(OAuthError.TokenResponse.INVALID_GRANT)
+ .setErrorDescription("invalid assertion")
+ .buildJSONMessage();
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ }
+
+ } else if (oauthRequest.getParam(OAuth.OAUTH_GRANT_TYPE)
+ .equals(GrantType.REFRESH_TOKEN.toString())) {
+ OAuthResponse response = OAuthASResponse
+ .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
+ .setError(OAuthError.TokenResponse.INVALID_GRANT)
+ .setErrorDescription("invalid username or password")
+ .buildJSONMessage();
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ }
+
+ OAuthResponse response = OAuthASResponse
+ .tokenResponse(HttpServletResponse.SC_OK)
+ .setAccessToken(oauthIssuerImpl.accessToken())
+ .setExpiresIn("3600")
+ .buildJSONMessage();
+
+ return Response.status(response.getResponseStatus()).entity(response.getBody()).build();
+ } catch (OAuthProblemException e) {
+ OAuthResponse res = OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST).error(e)
+ .buildJSONMessage();
+ return Response.status(res.getResponseStatus()).entity(res.getBody()).build();
+ }
+ }
+
+}
\ No newline at end of file
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/endpoints/TokenEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/AbstractJettyServerTest.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/AbstractJettyServerTest.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/AbstractJettyServerTest.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/AbstractJettyServerTest.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,84 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.server;
+
+import java.net.URISyntaxException;
+
+import org.apache.amber.oauth2.integration.Common;
+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 Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+public abstract class AbstractJettyServerTest {
+ protected AbstractJettyServerTest() {
+ }
+
+ private static org.eclipse.jetty.server.Server server;
+
+ @BeforeClass
+ public static void run() throws Exception {
+
+ server = new org.eclipse.jetty.server.Server();
+
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setPort(Integer.parseInt("9000"));
+ server.setConnectors(new Connector[] {connector});
+
+ WebAppContext webappcontext = new WebAppContext();
+ String contextPath = null;
+ try {
+ contextPath = ExampleServlet.class.getResource(Common.TEST_WEBAPP_PATH).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: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/AbstractJettyServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ExampleServlet.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ExampleServlet.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ExampleServlet.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ExampleServlet.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.server;
+
+import java.io.IOException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+public class ExampleServlet extends HttpServlet {
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void init() throws ServletException {
+ super.init(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ super
+ .doGet(req, resp); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ super.doPost(req,
+ resp); //To change body of overridden methods use File | Settings | File Templates.
+ }
+}
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ExampleServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ResourceServlet.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ResourceServlet.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ResourceServlet.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ResourceServlet.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,58 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.server;
+
+import java.io.IOException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+public class ResourceServlet extends HttpServlet {
+
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void init() throws ServletException {
+ super.init(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ super
+ .doGet(req, resp); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ super.doPost(req,
+ resp); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+}
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ResourceServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ServerTest.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ServerTest.java?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ServerTest.java (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ServerTest.java Sat Dec 18 17:02:42 2010
@@ -0,0 +1,37 @@
+/**
+ * Copyright 2010 Newcastle University
+ *
+ * http://research.ncl.ac.uk/smart/
+ *
+ * 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.amber.oauth2.integration.server;
+
+import org.junit.Test;
+
+/**
+ * @author Maciej Machulak (m.p.machulak@ncl.ac.uk)
+ * @author Lukasz Moren (lukasz.moren@ncl.ac.uk)
+ * @author Aad van Moorsel (aad.vanmoorsel@ncl.ac.uk)
+ */
+public class ServerTest extends AbstractJettyServerTest {
+
+ @Test
+ public void test() throws Exception {
+
+ }
+}
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/java/org/apache/amber/oauth2/integration/server/ServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/log4j.properties?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/log4j.properties (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/log4j.properties Sat Dec 18 17:02:42 2010
@@ -0,0 +1,29 @@
+#
+# Copyright 2010 Newcastle University
+#
+# http://research.ncl.ac.uk/smart/
+#
+# 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.
+#
+
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=[%d{yyyy-mm-dd hh:mm:ss.S},%6.6r]%-5p[%t]%x(%F:%L) - %m%n
+
+#log4j.logger.org.hibernate.search=TRACE
\ No newline at end of file
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/oauth-beans.xml
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/oauth-beans.xml?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/oauth-beans.xml (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/oauth-beans.xml Sat Dec 18 17:02:42 2010
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2010 Newcastle University
+
+ http://research.ncl.ac.uk/smart/
+
+ 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"/>-->
+
+ <!--OAuth Authorization Server Extended - Client Registration -->
+ <jaxrs:server id="oauthServerExt" address="http://localhost:9000/auth/oauth2ext/">
+ <jaxrs:serviceBeans>
+ <ref bean="registrationEndpoint"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="registrationEndpoint"
+ class="org.apache.amber.oauth2.integration.endpoints.RegistrationEndpoint"/>
+
+ <!--OAuth Authorization Server -->
+ <jaxrs:server id="oauthServer" address="http://localhost:9001/auth/oauth2/">
+ <jaxrs:serviceBeans>
+ <ref bean="authzEndpoint"/>
+ <ref bean="tokenEndpoint"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="authzEndpoint"
+ class="org.apache.amber.oauth2.integration.endpoints.AuthzEndpoint"/>
+ <bean id="tokenEndpoint" class="org.apache.amber.oauth2.integration.endpoints.TokenEndpoint"/>
+
+ <!--OAuth Client -->
+ <jaxrs:server id="oauthClient" address="http://localhost:9002/auth/oauth2/">
+ <jaxrs:serviceBeans>
+ <ref bean="clientRedirect"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="clientRedirect" class="org.apache.amber.oauth2.integration.EndUserAuthorizationTest"/>
+
+ <!-- Resource Server -->
+ <jaxrs:server id="resourceServer" address="http://localhost:9003/resource_server/">
+ <jaxrs:serviceBeans>
+ <ref bean="resourceHeaderEndpoint"/>
+ <ref bean="resourceBodyEndpoint"/>
+ <ref bean="resourceQueryEndpoint"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="resourceHeaderEndpoint"
+ class="org.apache.amber.oauth2.integration.endpoints.ResourceHeaderEndpoint"/>
+ <bean id="resourceBodyEndpoint"
+ class="org.apache.amber.oauth2.integration.endpoints.ResourceBodyEndpoint"/>
+ <bean id="resourceQueryEndpoint"
+ class="org.apache.amber.oauth2.integration.endpoints.ResourceQueryEndpoint"/>
+
+</beans>
\ No newline at end of file
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/oauth-beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/server/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/server/WEB-INF/web.xml?rev=1050671&view=auto
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/server/WEB-INF/web.xml (added)
+++ incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/server/WEB-INF/web.xml Sat Dec 18 17:02:42 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright 2010 Newcastle University
+
+ http://research.ncl.ac.uk/smart/
+
+ 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.
+
+-->
+
+<!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>
+
+ <servlet>
+ <servlet-name>testServlet</servlet-name>
+ <servlet-class>org.apache.amber.oauth2.integration.server.ExampleServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>testServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
+
Propchange: incubator/amber/trunk/oauth-2.0/oauth2-integration-tests/src/test/resources/server/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native