cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r981471 [1/2] - in /cxf/sandbox/oauth_1.0a: distribution/src/main/release/samples/ distribution/src/main/release/samples/oauth_1.0a/ distribution/src/main/release/samples/oauth_1.0a/client/ distribution/src/main/release/samples/oauth_1.0a/c...
Date Mon, 02 Aug 2010 12:06:56 GMT
Author: lmoren
Date: Mon Aug  2 12:06:53 2010
New Revision: 981471

URL: http://svn.apache.org/viewvc?rev=981471&view=rev
Log:
- added possibility to register new OAuth client applications at OAuth server
- OAuth demos moved to distribution\src\main\samples\
- added README to OAuth demos
- fixes in pom.xml files

Added:
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/
      - copied from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java   (with props)
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/spring-servlet.xml   (contents, props changed)
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/views/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/views/applicationDetails.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/views/newAppForm.jsp
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/index.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/views/registeredAppsList.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/oAuthLogin.jsp
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/AuthorizationService.java   (contents, props changed)
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/ResourceOwnerAuthorizationService.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/AuthorizationServiceImpl.java   (contents, props changed)
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/ResourceOwnerAuthorizationServiceImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/AuthzConfirmationService.java   (with props)
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/AuthzConfirmationServiceImpl.java   (with props)
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthNInfo.java   (contents, props changed)
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthenticationInfo.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthNInfoImpl.java   (contents, props changed)
      - copied, changed from r979824, cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthenticationInfoImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/token/
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/token/MD5TokenGenerator.java   (with props)
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/token/TokenGenerator.java   (with props)
Removed:
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/sample/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/rs/
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/login.jsp
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/ResourceOwnerAuthorizationService.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/ResourceOwnerAuthorizationServiceImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthenticationInfo.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ClientAuthenticationInfoImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/
Modified:
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/pom.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/accessToken.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/web.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/pom.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/oauth-beans.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/security-beans.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/WEB-INF/web.xml
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/webapp/index.jsp
    cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/pom.xml
    cxf/sandbox/oauth_1.0a/parent/pom.xml
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/pom.xml
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/TokenCredentialsServiceImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityInterceptor.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/AccessToken.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/OAuthDataProvider.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/OAuthDataProviderImpl.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/RequestToken.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/provider/Token.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/main/java/org/apache/cxf/auth/oauth/utils/OAuthUtils.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/JUnit4SpringContextTests.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/OAuthResponseMessage.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/java/org/apache/cxf/auth/oauth/endpoints/TemporaryCredentialServiceTest.java
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/src/test/resources/oauth-beans.xml

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT Mon Aug  2 12:06:53 2010
@@ -0,0 +1,64 @@
+OAuth 1.0a demo (client and server)
+========================================
+//todo check typos
+The OAuth 1.0a demo that shows protocol's flow between OAuth parties. Demo contains two parts:
+
+    client:
+            A web application capable of making OAuth-authenticated requests. It is usual OAuth client,
+            not dependent on Apache CXF framework, built to test this demo server part and for OAuth
+            educational purposes. Implementation works with any OAuth 1.0a providers, not only inluded
+            in this demo.
+
+
+    server:
+            A web application capable of accepting OAuth-authenticated requests. It bases on Apache
+            CXF OAuth module. It exposes OAuth endpoints and protected resources in the form of JAX-RS
+            services. Server demo shows and explains how CXF OAuth module can be configured to secure
+            JAX-RS services and integrated with existing web applications.
+
+Building and running the demo using maven
+---------------------------------------
+	
+    client:
+            Main directory of client demo application is located in folder: "client", in base folder
+            of this sample.
+            To start demo app use maven command:
+
+            mvn jetty:run -Pspring3
+
+            It will cause in starting Jetty web server and deploying client application at host on port: 8080.
+            Port number is defined in pom.xml.
+
+    server:
+            Main directory of server demo application is located in folder: "server", in base folder
+            of this sample.
+            To start demo app use maven command:
+
+            mvn jetty:run -Pspring3
+
+            It will cause in starting Jetty web server and deploying client application at host on port: 8081.
+            Port number is defined in pom.xml.
+
+			
+	Both client and server modules sepends on Spring 3, so you need to use CXF spring3 profile.
+	You can build both client and server modules using command: 
+			
+			mvn clean install -Pspring3
+			
+	and deploy war from 'target' folder in selected web container.
+
+Performing steps in OAuth flow 
+-----------------------------
+When you have successfully deployed client and server you can start now with OAuth steps:
+1. Go to OAuth server (http://localhost:8081) and login with given username and password
+2. Provide details and register new application at OAuth server.
+3. You have registered client application at OAuth server, with associated and displayed
+  client identifier, client shared-secret and callback url. You will need those on client side.
+4. Go to OAuth client demo (http://localhost:8080) and provide information about just registered app.
+5. Perform usuall OAuth 1.0 flow steps
+
+
+
+Running OAuth 1.0a demo at Google App Engine
+-----------------------------
+//todo add challenges in deploying demo to GAE
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/README.TXT
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/pom.xml?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/pom.xml Mon Aug  2 12:06:53 2010
@@ -3,33 +3,31 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 		 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.cxf</groupId>
-    <artifactId>cxf-rt-rs-oauth_samples-client</artifactId>
-    <version>2.3.0-SNAPSHOT</version>
+    <groupId>org.apache.cxf.samples</groupId>
+    <artifactId>oauth_demo-client</artifactId>
     <name>OAuth 1.0a client</name>
     <url>http://cxf.apache.org</url>
     <packaging>war</packaging>
 
     <parent>
-        <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-parent</artifactId>
+        <groupId>org.apache.cxf.samples</groupId>
+        <artifactId>cxf-samples</artifactId>
         <version>2.3.0-SNAPSHOT</version>
-        <relativePath>../../../../parent/pom.xml</relativePath>
     </parent>
 
     <build>
-        <finalName>oauth_1.0_client</finalName>
+        <finalName>oauth_1.0a_client</finalName>
         <plugins>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-                <version>6.1.24</version>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>${jetty.version}</version>
                 <configuration>
                     <webAppConfig>
                         <contextPath>/</contextPath>
                     </webAppConfig>
                     <connectors>
-                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                             <port>8080</port>
                             <maxIdleTime>60000</maxIdleTime>
                         </connector>
@@ -41,8 +39,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
+                    <source>${jdk.version}</source>
+                    <target>${jdk.version}</target>
                 </configuration>
             </plugin>
         </plugins>
@@ -52,38 +50,35 @@
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
-            <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>
-            <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
-            <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-beans</artifactId>
-            <version>${spring.version}</version>
         </dependency>
+
         <dependency>
             <groupId>net.oauth.core</groupId>
             <artifactId>oauth-consumer</artifactId>
-            <version>${oauth.lib.version}</version>
+            <version>${oauth.version}</version>
         </dependency>
         <dependency>
             <groupId>net.oauth.core</groupId>
             <artifactId>oauth-provider</artifactId>
-            <version>${oauth.lib.version}</version>
         </dependency>
+
         <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.5</version>
+            <groupId>${servlet-api.group}</groupId>
+            <artifactId>${servlet-api.artifact}</artifactId>
         </dependency>
+
         <dependency>
             <artifactId>standard</artifactId>
             <groupId>taglibs</groupId>
@@ -91,12 +86,13 @@
             <type>jar</type>
             <scope>runtime</scope>
         </dependency>
-
     </dependencies>
 
-    <properties>
-        <!--Spring 3 required to be deployable at GAE-->
-        <spring.version>3.0.2.RELEASE</spring.version>
-        <oauth.lib.version>20100527</oauth.lib.version>
-    </properties>
+    <repositories>
+        <repository>
+            <id>oauth</id>
+            <name>OAuth Repository</name>
+            <url>http://oauth.googlecode.com/svn/code/maven/</url>
+        </repository>
+    </repositories>
 </project>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java Mon Aug  2 12:06:53 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.demo.client.controllers;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cxf.auth.oauth.demo.client.model.OAuthParams;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class AuthorizeResourceOwnerController {
+
+    @RequestMapping("/authorizeResourceOwner")
+    public void handleRequest(@ModelAttribute(value = "oAuthParams") OAuthParams oAuthParams,
+                              HttpServletResponse response) throws Exception {
+
+        String oauthToken = oAuthParams.getOauthToken();
+        String resourceOwnerAuthorizationEndpoint = oAuthParams.getResourceOwnerAuthorizationEndpoint();
+        if (resourceOwnerAuthorizationEndpoint == null || "".equals(resourceOwnerAuthorizationEndpoint)) {
+            oAuthParams.setErrorMessage("Missing resource owner authorization URI");
+        }
+
+        if (oauthToken == null || "".equals(oauthToken)) {
+            oAuthParams.setErrorMessage("Missing oauth token");
+        }
+
+        response
+            .sendRedirect(
+                resourceOwnerAuthorizationEndpoint + "?oauth_token=" + oauthToken);
+    }
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/AuthorizeResourceOwnerController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,58 @@
+/**
+ * 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.demo.client.controllers;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthMessage;
+import net.oauth.server.OAuthServlet;
+
+import org.apache.cxf.auth.oauth.demo.client.model.Common;
+import org.apache.cxf.auth.oauth.demo.client.model.OAuthParams;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class CallbackURLController {
+
+    @RequestMapping("/callback")
+    protected ModelAndView handleRequest(@ModelAttribute("oAuthParams") OAuthParams oAuthParams,
+                                         HttpServletRequest request) throws Exception {
+
+        OAuthMessage message = OAuthServlet.getMessage(request, request.getRequestURL().toString());
+
+        message.requireParameters(OAuth.OAUTH_TOKEN, OAuth.OAUTH_VERIFIER);
+        oAuthParams.setOauthToken(message.getToken());
+        oAuthParams.setOauthVerifier(message.getParameter(OAuth.OAUTH_VERIFIER));
+
+        oAuthParams.setClientID(Common.findCookieValue(request, "clientID"));
+        oAuthParams.setClientSecret(Common.findCookieValue(request, "clientSecret"));
+
+
+        return new ModelAndView("tokenRequest");
+    }
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/CallbackURLController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,113 @@
+/**
+ * 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.demo.client.controllers;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthAccessor;
+import net.oauth.OAuthConsumer;
+import net.oauth.OAuthMessage;
+import net.oauth.OAuthServiceProvider;
+import net.oauth.ParameterStyle;
+import net.oauth.client.OAuthClient;
+import net.oauth.client.URLConnectionClient;
+
+import org.apache.cxf.auth.oauth.demo.client.model.OAuthParams;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author Lukasz Moren
+ */
+
+@Controller
+public class GetProtectedResourceController {
+
+    @RequestMapping("/getProtectedResource")
+    protected ModelAndView handleRequest(@ModelAttribute("oAuthParams") OAuthParams oAuthParams)
+        throws Exception {
+
+        OAuthServiceProvider provider = new OAuthServiceProvider(
+            oAuthParams.getTemporaryCredentialsEndpoint(),
+            oAuthParams.getResourceOwnerAuthorizationEndpoint(), null);
+
+        OAuthConsumer consumer = new OAuthConsumer(null, oAuthParams.getClientID(),
+            oAuthParams.getClientSecret(),
+            provider);
+        OAuthAccessor accessor = new OAuthAccessor(consumer);
+
+
+        Map<String, String> parameters = new HashMap<String, String>();
+        parameters.put(OAuth.OAUTH_SIGNATURE_METHOD, oAuthParams.getSignatureMethod());
+        parameters.put(OAuth.OAUTH_NONCE, UUID.randomUUID().toString());
+        parameters.put(OAuth.OAUTH_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
+        parameters.put(OAuth.OAUTH_TOKEN, oAuthParams.getOauthToken());
+        parameters.put(OAuth.OAUTH_CONSUMER_KEY, oAuthParams.getClientID());
+
+        OAuthMessage msg = accessor
+            .newRequestMessage(OAuthMessage.GET, oAuthParams.getResourceURL(), parameters.entrySet());
+
+        OAuthClient client = new OAuthClient(new URLConnectionClient());
+
+
+        msg = client.access(msg, ParameterStyle.AUTHORIZATION_HEADER);
+
+        StringBuffer bodyBuffer = readBody(msg);
+
+        oAuthParams.setResourceResponse(bodyBuffer.toString());
+        oAuthParams.setHeader(msg.getHeader("WWW-Authenticate"));
+
+        return new ModelAndView("accessToken");
+    }
+
+    private StringBuffer 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;
+    }
+
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/GetProtectedResourceController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,118 @@
+/**
+ * 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.demo.client.controllers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthAccessor;
+import net.oauth.OAuthConsumer;
+import net.oauth.OAuthMessage;
+import net.oauth.OAuthServiceProvider;
+import net.oauth.client.OAuthClient;
+import net.oauth.client.URLConnectionClient;
+
+import org.apache.cxf.auth.oauth.demo.client.model.OAuthParams;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class TemporaryCredentialsController {
+
+    @RequestMapping("/handleTemporaryCredentials")
+    public ModelAndView handleRequest(@ModelAttribute(value = "oAuthParams") OAuthParams oAuthParams,
+                                      HttpServletResponse response) {
+
+        OAuthServiceProvider provider;
+        OAuthConsumer consumer;
+        OAuthAccessor accessor;
+
+        OAuthClient client = new OAuthClient(new URLConnectionClient());
+
+        oAuthParams.setErrorMessage(null);
+        String temporaryCredentialsEndpointUrl = oAuthParams.getTemporaryCredentialsEndpoint();
+        if (temporaryCredentialsEndpointUrl == null || "".equals(temporaryCredentialsEndpointUrl)) {
+            oAuthParams.setErrorMessage("Missing temporary credentials endpoint url");
+        }
+        String clientId = oAuthParams.getClientID();
+        if (clientId == null || "".equals(clientId)) {
+            oAuthParams.setErrorMessage("Missing client identifier");
+        }
+        String secret = oAuthParams.getClientSecret();
+        if (secret == null || "".equals(secret)) {
+            oAuthParams.setErrorMessage("Missing client shared-secret");
+        }
+
+        if (oAuthParams.getErrorMessage() == null) {
+            provider = new OAuthServiceProvider(temporaryCredentialsEndpointUrl,
+                oAuthParams.getResourceOwnerAuthorizationEndpoint(), oAuthParams.getTokenRequestEndpoint());
+            consumer = new OAuthConsumer(null, clientId,
+                secret,
+                provider);
+            accessor = new OAuthAccessor(consumer);
+
+            Map<String, String> parameters = new HashMap<String, String>();
+            parameters.put(OAuth.OAUTH_SIGNATURE_METHOD, oAuthParams.getSignatureMethod());
+            parameters.put(OAuth.OAUTH_NONCE, UUID.randomUUID().toString());
+            parameters.put(OAuth.OAUTH_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
+            parameters.put(OAuth.OAUTH_CALLBACK, oAuthParams.getCallbackURL());
+
+            try {
+                client.getRequestToken(accessor, OAuthMessage.POST, parameters.entrySet());
+            } catch (Exception e) {
+                oAuthParams.setErrorMessage(e.toString());
+            }
+
+            oAuthParams.setOauthToken(accessor.requestToken);
+            oAuthParams.setOauthTokenSecret(accessor.tokenSecret);
+
+            Cookie cId = new Cookie("clientID", oAuthParams.getClientID());
+            Cookie cSec = new Cookie("clientSecret", oAuthParams.getClientSecret());
+            response.addCookie(cId);
+            response.addCookie(cSec);
+        }
+
+        ModelAndView modelAndView = new ModelAndView();
+        if (oAuthParams.getErrorMessage() != null) {
+            modelAndView.setViewName("temporaryCredentials");
+        } else {
+            modelAndView.setViewName("authorizeResourceOwner");
+        }
+
+        return modelAndView;
+    }
+
+    @RequestMapping("/temporaryCredentials")
+    public ModelAndView handleInternalRequest(
+        @ModelAttribute(value = "oAuthParams") OAuthParams oAuthParams) {
+        return new ModelAndView("temporaryCredentials");
+    }
+
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TemporaryCredentialsController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,111 @@
+/**
+ * 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.demo.client.controllers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthAccessor;
+import net.oauth.OAuthConsumer;
+import net.oauth.OAuthMessage;
+import net.oauth.OAuthServiceProvider;
+import net.oauth.client.OAuthClient;
+import net.oauth.client.URLConnectionClient;
+
+import org.apache.cxf.auth.oauth.demo.client.model.Common;
+import org.apache.cxf.auth.oauth.demo.client.model.OAuthParams;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class TokenRequestController {
+
+    @RequestMapping("/tokenRequest")
+    protected ModelAndView handleRequest(@ModelAttribute("oAuthParams") OAuthParams oAuthParams, HttpServletRequest request)
+        throws Exception {
+
+        String oauthToken = oAuthParams.getOauthToken();
+
+        String tokenRequestEndpoint = oAuthParams.getTokenRequestEndpoint();
+        String clientID = oAuthParams.getClientID();
+
+        if (tokenRequestEndpoint == null || "".equals(tokenRequestEndpoint)) {
+            oAuthParams.setErrorMessage("Missing token request URI");
+        }
+
+        if (clientID == null || "".equals(clientID)) {
+            oAuthParams.setErrorMessage("Missing consumer key");
+        }
+
+        if (oauthToken == null || "".equals(oauthToken)) {
+            oAuthParams.setErrorMessage("Missing oauth token");
+        }
+
+        String verifier = oAuthParams.getOauthVerifier();
+        if (verifier == null || "".equals(verifier)) {
+            oAuthParams.setErrorMessage("Missing oauth verifier");
+        }
+
+        if (oAuthParams.getErrorMessage() == null) {
+            OAuthClient client = new OAuthClient(new URLConnectionClient());
+            OAuthServiceProvider provider = new OAuthServiceProvider(
+                oAuthParams.getTemporaryCredentialsEndpoint(),
+                oAuthParams.getResourceOwnerAuthorizationEndpoint(), tokenRequestEndpoint);
+
+            OAuthConsumer consumer = new OAuthConsumer(null, clientID,
+                oAuthParams.getClientSecret(),
+                provider);
+            OAuthAccessor accessor = new OAuthAccessor(consumer);
+
+            Map<String, String> parameters = new HashMap<String, String>();
+            parameters.put(OAuth.OAUTH_SIGNATURE_METHOD, oAuthParams.getSignatureMethod());
+            parameters.put(OAuth.OAUTH_NONCE, UUID.randomUUID().toString());
+            parameters.put(OAuth.OAUTH_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
+            parameters.put(OAuth.OAUTH_TOKEN, oauthToken);
+            parameters.put(OAuth.OAUTH_VERIFIER, oAuthParams.getOauthVerifier());
+
+
+            try {
+                client.getAccessToken(accessor, OAuthMessage.GET, parameters.entrySet());
+                oAuthParams.setOauthToken(accessor.accessToken);
+            } catch (Exception e) {
+                oAuthParams.setErrorMessage(e.toString());
+                oAuthParams.setOauthToken(oauthToken);
+                return new ModelAndView("tokenRequest");
+            }
+            oAuthParams.setOauthTokenSecret(accessor.tokenSecret);
+        }
+
+        oAuthParams.setClientID(Common.findCookieValue(request, "clientID"));
+        oAuthParams.setClientSecret(Common.findCookieValue(request, "clientSecret"));
+
+        return new ModelAndView("accessToken");
+    }
+
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/controllers/TokenRequestController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,20 @@
+package org.apache.cxf.auth.oauth.demo.client.model;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author Lukasz Moren
+ */
+public class Common {
+    public static String findCookieValue(HttpServletRequest request, String key) {
+        Cookie[] cookies = request.getCookies();
+
+        for (Cookie cooky : cookies) {
+            if (cooky.getName().equals(key)) {
+                return cooky.getValue();
+            }
+        }
+        return "";
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/Common.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,196 @@
+/**
+ * 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.demo.client.model;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Lukasz Moren
+ */
+public class OAuthParams implements Serializable {
+    private String temporaryCredentialsEndpoint = "http://localhost:8081/auth/oauth/initiate";
+    private String resourceOwnerAuthorizationEndpoint = "http://localhost:8081/auth/oauth/authorize";
+    private String tokenRequestEndpoint = "http://localhost:8081/auth/oauth/token";
+    private String resourceURL = "http://localhost:8081/auth/resources/person/john";
+
+    private String callbackURL = "http://localhost:8080/app/callback";
+
+    private String clientID = "12345678";
+    private String clientSecret = "secret";
+    private String signatureMethod;
+
+    private String oauthToken;
+    private String oauthTokenSecret;
+    private String oauthVerifier;
+
+    private String errorMessage;
+    private String resourceResponse;
+    private String header;
+
+    private List<SignatureMethod> methods = new ArrayList<SignatureMethod>();
+
+    public OAuthParams() {
+        methods.add(new SignatureMethod("PLAINTEXT"));
+        methods.add(new SignatureMethod("HMAC-SHA1"));
+    }
+
+    public OAuthParams(String clientSecret, String clientID) {
+        super();
+        this.clientSecret = clientSecret;
+        this.clientID = clientID;
+    }
+
+    public String getClientSecret() {
+        return clientSecret;
+    }
+
+    public void setClientSecret(String clientSecret) {
+        this.clientSecret = clientSecret;
+    }
+
+    public String getClientID() {
+        return clientID;
+    }
+
+    public void setClientID(String clientID) {
+        this.clientID = clientID;
+    }
+
+    public String getSignatureMethod() {
+        return signatureMethod;
+    }
+
+    public void setSignatureMethod(String signatureMethod) {
+        this.signatureMethod = signatureMethod;
+    }
+
+    public String getTemporaryCredentialsEndpoint() {
+        return temporaryCredentialsEndpoint;
+    }
+
+    public void setTemporaryCredentialsEndpoint(String temporaryCredentialsEndpoint) {
+        this.temporaryCredentialsEndpoint = temporaryCredentialsEndpoint;
+    }
+
+    public String getOauthToken() {
+        return oauthToken;
+    }
+
+    public void setOauthToken(String oauthToken) {
+        this.oauthToken = oauthToken;
+    }
+
+    public String getOauthTokenSecret() {
+        return oauthTokenSecret;
+    }
+
+    public void setOauthTokenSecret(String oauthTokenSecret) {
+        this.oauthTokenSecret = oauthTokenSecret;
+    }
+
+    public String getResourceOwnerAuthorizationEndpoint() {
+        return resourceOwnerAuthorizationEndpoint;
+    }
+
+    public void setResourceOwnerAuthorizationEndpoint(String resourceOwnerAuthorizationEndpoint) {
+        this.resourceOwnerAuthorizationEndpoint = resourceOwnerAuthorizationEndpoint;
+    }
+
+    public String getTokenRequestEndpoint() {
+        return tokenRequestEndpoint;
+    }
+
+    public void setTokenRequestEndpoint(String tokenRequestEndpoint) {
+        this.tokenRequestEndpoint = tokenRequestEndpoint;
+    }
+
+    public String getOauthVerifier() {
+        return oauthVerifier;
+    }
+
+    public void setOauthVerifier(String oauthVerifier) {
+        this.oauthVerifier = oauthVerifier;
+    }
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public String getResourceURL() {
+        return resourceURL;
+    }
+
+    public void setResourceURL(String resourceURL) {
+        this.resourceURL = resourceURL;
+    }
+
+    public String getCallbackURL() {
+        return callbackURL;
+    }
+
+    public void setCallbackURL(String callbackURL) {
+        this.callbackURL = callbackURL;
+    }
+
+    public String getResourceResponse() {
+        return resourceResponse;
+    }
+
+    public void setResourceResponse(String resourceResponse) {
+        this.resourceResponse = resourceResponse;
+    }
+
+    public String getHeader() {
+        return header;
+    }
+
+    public void setHeader(String header) {
+        this.header = header;
+    }
+
+    public List getMethods() {
+        return methods;
+    }
+
+    public void setMethods(List<SignatureMethod> methods) {
+        this.methods = methods;
+    }
+
+    static class SignatureMethod {
+        private String methodName;
+
+        SignatureMethod(String methodName) {
+            this.methodName = methodName;
+        }
+
+        public String getMethodName() {
+            return methodName;
+        }
+
+        public void setMethodName(String methodName) {
+            this.methodName = methodName;
+        }
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/java/org/apache/cxf/auth/oauth/demo/client/model/OAuthParams.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml Mon Aug  2 12:06:53 2010
@@ -0,0 +1,36 @@
+<!--
+  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:context="http://www.springframework.org/schema/context"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context
+       http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
+
+    <mvc:annotation-driven/>
+    <context:annotation-config/>
+    <context:component-scan base-package="org.apache.cxf.auth.oauth.demo.client"/>
+
+    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="prefix" value="/WEB-INF/views/"/>
+        <property name="suffix" value=".jsp"/>
+    </bean>
+
+</beans>
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/spring-servlet.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/accessToken.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/accessToken.jsp?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/accessToken.jsp (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/accessToken.jsp Mon Aug  2 12:06:53 2010
@@ -1,22 +1,22 @@
 <!--
-  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
+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
+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.
+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.
 -->
-<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.client.model.OAuthParams"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.demo.client.model.OAuthParams"--%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ page isELIgnored="false" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
@@ -45,6 +45,14 @@
             <td><form:input size="70" path="oauthTokenSecret"/></td>
         </tr>
         <tr>
+            <td>Client Identifier:</td>
+            <td><form:input size="70" path="clientID"/></td>
+        </tr>
+        <tr>
+            <td>Client Shared-Secret:</td>
+            <td><form:input size="70" path="clientSecret"/></td>
+        </tr>
+        <tr>
             <td>OAuth Protected Resource URI:</td>
             <td><form:input size="70" path="resourceURL"/></td>
         </tr>

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp Mon Aug  2 12:06:53 2010
@@ -17,7 +17,7 @@
   under the License.
 -->
 <%--@elvariable id="text" type="java.lang.String"--%>
-<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.client.model.OAuthParams"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.demo.client.model.OAuthParams"--%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ page isELIgnored="false" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp Mon Aug  2 12:06:53 2010
@@ -17,7 +17,7 @@
   under the License.
 -->
 <%--@elvariable id="text" type="java.lang.String"--%>
-<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.client.model.OAuthParams"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.demo.client.model.OAuthParams"--%>
 <%--@elvariable id="methods" type="java.util.List"--%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ page isELIgnored="false" %>

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp Mon Aug  2 12:06:53 2010
@@ -17,7 +17,7 @@ specific language governing permissions 
 under the License.
 -->
 <%--@elvariable id="text" type="java.lang.String"--%>
-<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.client.model.OAuthParams"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.demo.client.model.OAuthParams"--%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ page isELIgnored="false" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
@@ -46,11 +46,11 @@ under the License.
         </tr>
         <tr>
             <td>OAuth Token:</td>
-            <td><form:input type="text" size="70" path="oauthToken"/></td>
+            <td><form:input size="70" path="oauthToken"/></td>
         </tr>
         <tr>
             <td>OAuth Verifier:</td>
-            <td><form:input type="text" size="70" path="oauthVerifier"/></td>
+            <td><form:input size="70" path="oauthVerifier"/></td>
         </tr>
         <tr>
             <td>&nbsp;</td>
@@ -69,6 +69,10 @@ under the License.
             <td><form:input size="70" path="clientID"/></td>
         </tr>
         <tr>
+            <td>Client Shared-Secret:</td>
+            <td><form:input size="70" path="clientSecret"/></td>
+        </tr>
+        <tr>
             <td>Signature Method:</td>
             <td>
                 <form:select path="signatureMethod">

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/web.xml?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/web.xml (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/client/src/main/webapp/WEB-INF/web.xml Mon Aug  2 12:06:53 2010
@@ -19,8 +19,8 @@
 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-		  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-         version="2.5">
+         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         metadata-complete="true" version="2.5">
 
     <context-param>
         <param-name>contextConfigLocation</param-name>

Modified: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/pom.xml?rev=981471&r1=979824&r2=981471&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/pom.xml Mon Aug  2 12:06:53 2010
@@ -3,21 +3,19 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 		 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.cxf</groupId>
-    <artifactId>cxf-rt-rs-oauth_samples-server</artifactId>
+    <groupId>org.apache.cxf.samples</groupId>
+    <artifactId>oauth_demo-server</artifactId>
     <name>OAuth 1.0a server</name>
-    <version>2.3.0-SNAPSHOT</version>
     <packaging>war</packaging>
 
     <parent>
-        <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-parent</artifactId>
+        <groupId>org.apache.cxf.samples</groupId>
+        <artifactId>cxf-samples</artifactId>
         <version>2.3.0-SNAPSHOT</version>
-        <relativePath>../../../../parent/pom.xml</relativePath>
     </parent>
 
     <build>
-        <finalName>oauth_1.0_server</finalName>
+        <finalName>oauth_1.0a_server</finalName>
         <plugins>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
@@ -40,8 +38,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
+                    <source>${jdk.version}</source>
+                    <target>${jdk.version}</target>
                 </configuration>
             </plugin>
         </plugins>
@@ -55,15 +53,9 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-transports-http</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>${project.version}</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
@@ -79,6 +71,7 @@
             <artifactId>spring-webmvc</artifactId>
             <version>${spring.version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
@@ -114,6 +107,7 @@
             <artifactId>spring-security-taglibs</artifactId>
             <version>${spring-security.version}</version>
         </dependency>
+
         <dependency>
             <artifactId>standard</artifactId>
             <groupId>taglibs</groupId>
@@ -124,7 +118,6 @@
     </dependencies>
 
     <properties>
-        <spring.version>2.5.6</spring.version>
         <spring-security.version>2.0.5.RELEASE</spring-security.version>
     </properties>
 </project>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,54 @@
+/**
+ * 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.demo.server;
+
+import java.io.Serializable;
+
+/**
+ * @author Lukasz Moren
+ */
+public class Application implements Serializable {
+    private String applicationName = "OAuth 1.0a client";
+    private String callbackURL = "http://localhost:8080/app/callback";
+    private String error;
+
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getCallbackURL() {
+        return callbackURL;
+    }
+
+    public void setCallbackURL(String callbackURL) {
+        this.callbackURL = callbackURL;
+    }
+
+    public String getError() {
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/Application.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java Mon Aug  2 12:06:53 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.demo.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+/** Sample JAX-RS resource service
+ * @author Lukasz Moren
+ */
+@Path("/")
+public class SampleResourceProvider {
+
+    @GET
+    @Produces("text/html")
+    @Path("/person/{name}")
+    public Response returnSampleImage(@PathParam("name") String name) {
+        return Response.ok("Successfully accessed OAuth protected person: " + name).build();
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/SampleResourceProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,102 @@
+/**
+ * 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.demo.server.controllers;
+
+import java.security.SecureRandom;
+import java.util.Set;
+
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfo;
+import org.apache.cxf.auth.oauth.provider.ClientAuthNInfoImpl;
+import org.apache.cxf.auth.oauth.provider.OAuthDataProvider;
+import org.apache.cxf.auth.oauth.token.MD5TokenGenerator;
+import org.apache.cxf.auth.oauth.token.TokenGenerator;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.auth.oauth.demo.server.Application;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.context.SecurityContextHolder;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class ApplicationController {
+
+    @Autowired
+    private OAuthDataProvider oauthDataProvider;
+
+    @RequestMapping("/newAppForm")
+    public ModelAndView handleRequest(@ModelAttribute("application") Application app) {
+        return new ModelAndView("newAppForm");
+    }
+
+    @RequestMapping("/registerApp")
+    public ModelAndView registerApp(@ModelAttribute("application") Application app)
+        throws Exception {
+
+        if (StringUtils.isEmpty(app.getApplicationName()) || StringUtils.isEmpty(app.getCallbackURL())) {
+            app.setError("All fields are required!");
+
+            return handleInternalRedirect(app);
+        }
+
+        TokenGenerator tokenGen = new MD5TokenGenerator();
+        String loggedUserName = SecurityContextHolder.getContext().getAuthentication().getName();
+
+        String consumerKey = tokenGen
+            .generateToken((loggedUserName + app.getApplicationName()).getBytes("UTF-8"));
+        String secretKey = tokenGen.generateToken(new SecureRandom().generateSeed(20));
+
+        ClientAuthNInfo clientInfo = new ClientAuthNInfoImpl(consumerKey,
+            secretKey, app.getCallbackURL(), app.getApplicationName());
+
+
+        ClientAuthNInfo authNInfo = oauthDataProvider.addNewClient(loggedUserName, consumerKey, clientInfo);
+        if (authNInfo != null) {
+            app.setError("Application already exists!");
+
+            return handleInternalRedirect(app);
+        }
+
+        ModelAndView modelAndView = new ModelAndView("applicationDetails");
+        modelAndView.getModel().put("clientInfo", clientInfo);
+
+        return modelAndView;
+    }
+
+    @RequestMapping("/listRegisteredApps")
+    public ModelAndView listRegisteredApps() {
+        String user = SecurityContextHolder.getContext().getAuthentication().getName();
+        Set<ClientAuthNInfo> apps = oauthDataProvider.listAllUserClients(user);
+
+        ModelAndView modelAndView = new ModelAndView("registeredAppsList");
+        modelAndView.getModelMap().put("apps", apps);
+        return modelAndView;
+    }
+
+    private ModelAndView handleInternalRedirect(Application app) {
+        ModelAndView modelAndView = new ModelAndView("newAppForm");
+        modelAndView.getModel().put("application", app);
+        return modelAndView;
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/controllers/ApplicationController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,41 @@
+/**
+ * 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.demo.server.spring;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.oauth.OAuth;
+
+import org.springframework.security.AuthenticationException;
+import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
+
+/**
+ * Redirects to login page on login failure and save oauth_token value
+ *
+ * @author Lukasz Moren
+ */
+public class OAuthAuthenticationProcessingFilter extends AuthenticationProcessingFilter {
+
+    protected String determineFailureUrl(HttpServletRequest request, AuthenticationException failed) {
+        String failureUrl = super.determineFailureUrl(request, failed);
+        String oauthToken = request.getParameter(OAuth.OAUTH_TOKEN);
+        return new StringBuffer(failureUrl).append("?").append(OAuth.OAUTH_TOKEN).append("=")
+            .append(oauthToken).toString();
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/OAuthAuthenticationProcessingFilter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java?rev=981471&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java (added)
+++ cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java Mon Aug  2 12:06:53 2010
@@ -0,0 +1,65 @@
+/**
+ * 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.demo.server.spring;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cxf.auth.oauth.endpoints.AuthorizationService;
+import org.apache.cxf.common.util.StringUtils;
+
+import net.oauth.OAuth;
+
+import org.springframework.security.Authentication;
+import org.springframework.security.ui.TargetUrlResolver;
+import org.springframework.security.ui.TargetUrlResolverImpl;
+import org.springframework.security.ui.savedrequest.SavedRequest;
+
+/**
+ * Forward request params from login page to oauth confirmation endpoint.
+ * Spring Security clears request parameter passed to login page when redirects to defaultTargetUrl
+ *
+ * @author Lukasz Moren
+ */
+public class TargetURLResolver implements TargetUrlResolver {
+
+    TargetUrlResolverImpl defaultURLResolver = new TargetUrlResolverImpl();
+    private String confirmationUrl;
+
+    public String determineTargetUrl(final SavedRequest savedRequest,
+                                     final HttpServletRequest currentRequest, final Authentication auth) {
+
+
+        String oauthToken = currentRequest.getParameter(OAuth.OAUTH_TOKEN);
+        if (StringUtils.isEmpty(oauthToken)) {
+            return defaultURLResolver.determineTargetUrl(savedRequest, currentRequest, auth);
+        }
+        String secToken = currentRequest.getParameter(AuthorizationService.SEC_TOKEN);
+
+        StringBuffer url = new StringBuffer(confirmationUrl).append("?").append(OAuth.OAUTH_TOKEN).append("=")
+            .append(
+                oauthToken).append("&").append(AuthorizationService.SEC_TOKEN).append("=")
+            .append(secToken);
+
+        return url.toString();
+    }
+
+    public void setConfirmationUrl(String confirmationUrl) {
+        this.confirmationUrl = confirmationUrl;
+    }
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/distribution/src/main/release/samples/oauth_1.0a/server/src/main/java/org/apache/cxf/auth/oauth/demo/server/spring/TargetURLResolver.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message