cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r964212 [2/2] - in /cxf/sandbox/oauth_1.0a/rt/rs: oauth/ oauth/src/main/java/org/apache/cxf/auth/oauth/endpoints/ oauth/src/main/java/org/apache/cxf/auth/oauth/interceptors/ oauth/src/main/java/org/apache/cxf/auth/oauth/provider/ oauth/src/...
Date Wed, 14 Jul 2010 21:30:20 GMT
Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java Wed Jul 14 21:30:17 2010
@@ -0,0 +1,53 @@
+/**
+ * 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.sample.client.controllers;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.auth.oauth.sample.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;
+
+import net.oauth.OAuth;
+import net.oauth.OAuthMessage;
+import net.oauth.server.OAuthServlet;
+
+/**
+ * @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));
+
+        return new ModelAndView("tokenRequest");
+    }
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/CallbackURLController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java Wed Jul 14 21:30:17 2010
@@ -0,0 +1,112 @@
+/**
+ * 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.sample.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 org.apache.cxf.auth.oauth.sample.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;
+
+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;
+
+/**
+ * @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/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/GetProtectedResourceController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java Wed Jul 14 21:30:17 2010
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.auth.oauth.sample.client.controllers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.cxf.auth.oauth.sample.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;
+
+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;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class TemporaryCredentialsController {
+
+    @RequestMapping("/handleTemporaryCredentials")
+    public ModelAndView handleRequest(@ModelAttribute(value = "oAuthParams") OAuthParams oAuthParams) {
+
+        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);
+        }
+
+        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/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TemporaryCredentialsController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java Wed Jul 14 21:30:17 2010
@@ -0,0 +1,103 @@
+/**
+ * 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.sample.client.controllers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.cxf.auth.oauth.sample.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;
+
+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;
+
+/**
+ * @author Lukasz Moren
+ */
+@Controller
+public class TokenRequestController {
+
+    @RequestMapping("/tokenRequest")
+    protected ModelAndView handleRequest(@ModelAttribute("oAuthParams") OAuthParams oAuthParams)
+        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);
+        }
+        return new ModelAndView("accessToken");
+    }
+
+}
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/controllers/TokenRequestController.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java Wed Jul 14 21:30:17 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.sample.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/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/java/org/apache/cxf/auth/oauth/sample/client/model/OAuthParams.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/spring-servlet.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/spring-servlet.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/spring-servlet.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/spring-servlet.xml Wed Jul 14 21:30:17 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.sample.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/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/spring-servlet.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/accessToken.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/accessToken.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/accessToken.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/accessToken.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,73 @@
+<!--
+  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.
+-->
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.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" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+
+<html>
+<head>
+    <title>OAuth Client</title>
+</head>
+<body>
+<table align="center">
+    <tr>
+        <td><h2>Sample OAuth 1.0a client implementation</h2></td>
+    </tr>
+</table>
+<h3>Step 4. Get Protected Resource</h3>
+
+<form:form commandName="oAuthParams" action="/app/getProtectedResource">
+    <table>
+        <tr>
+            <td>OAuth Token:</td>
+            <td><form:input size="70" path="oauthToken"/></td>
+        </tr>
+        <tr>
+            <td>OAuth Secret:</td>
+            <td><form:input size="70" path="oauthTokenSecret"/></td>
+        </tr>
+        <tr>
+            <td>OAuth Protected Resource URI:</td>
+            <td><form:input size="70" path="resourceURL"/></td>
+        </tr>
+        <tr>
+            <td>Signature Method:</td>
+            <td><form:select path="signatureMethod">
+                <form:options items="${oAuthParams.methods}" itemValue="methodName"
+                              itemLabel="methodName"/>
+            </form:select></td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <input type="submit" value="Get Protected Resource"/>
+            </td>
+        </tr>
+    </table>
+</form:form>
+
+<c:if test="${!empty oAuthParams.resourceResponse}">
+    <p><b>Response:</b> ${oAuthParams.resourceResponse}</p>
+</c:if>
+<c:if test="${!empty oAuthParams.header}">
+    <p><b>Header:</b>${oAuthParams.header}</p>
+</c:if>
+</body>
+</html>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/authorizeResourceOwner.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,73 @@
+<!--
+  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.
+-->
+<%--@elvariable id="text" type="java.lang.String"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.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" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+
+<html>
+<head>
+    <title>OAuth 1.0a client</title>
+</head>
+<body>
+<table align="center">
+    <tr>
+        <td><h2>Sample OAuth 1.0a client implementation</h2></td>
+    </tr>
+</table>
+<h3>Step 2. Authorize Resource Owner</h3>
+
+<form:form commandName="oAuthParams" action="/app/authorizeResourceOwner">
+    <c:if test="${!empty oAuthParams.errorMessage}">
+        <font color="red"><p>Error: ${oAuthParams.errorMessage}</p></font>
+    </c:if>
+    <table>
+        <tr>
+            <td>Response:</td>
+        </tr>
+        <tr>
+            <td>OAuth Token:</td>
+            <td><form:input size="70" path="oauthToken"/></td>
+        </tr>
+        <tr>
+            <td>OAuth Token Secret:</td>
+            <td><form:input size="70" path="oauthTokenSecret"/></td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>&nbsp;</td>
+        </tr>
+        <tr>
+            <td>Required OAuth parameters:</td>
+        </tr>
+        <tr>
+            <td>Resource Owner Authorization Endpoint URI:</td>
+            <td><form:input size="70" path="resourceOwnerAuthorizationEndpoint"/></td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <input type="submit" value="Authorize Resource Owner"/>
+            </td>
+        </tr>
+    </table>
+</form:form>
+</body>
+</html>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/temporaryCredentials.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,83 @@
+<!--
+  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.
+-->
+<%--@elvariable id="text" type="java.lang.String"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.client.model.OAuthParams"--%>
+<%--@elvariable id="methods" type="java.util.List"--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page isELIgnored="false" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+
+<html>
+<head>
+    <title>OAuth 1.0a client</title>
+</head>
+<body>
+<table align="center">
+    <tr>
+        <td><h2>Sample OAuth 1.0a client implementation</h2></td>
+    </tr>
+</table>
+
+<p>
+
+<h3>Step 1. Get OAuth temporary credentials</h3></p>
+
+<form:form commandName="oAuthParams" action="/app/handleTemporaryCredentials">
+    <c:if test="${!empty oAuthParams.errorMessage}">
+        <font color="red"><p>Error: ${oAuthParams.errorMessage}</p></font>
+    </c:if>
+    <table>
+        <tr>
+            <td>Required OAuth parameters:</td>
+        </tr>
+        <tr>
+            <td>Temporary Credentials Endoint URI:</td>
+            <td><form:input size="70" path="temporaryCredentialsEndpoint"/></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>Callback URL:</td>
+            <td><form:input size="70" path="callbackURL"/></td>
+        </tr>
+        <tr>
+            <td>Signature Method:</td>
+            <td>
+                <form:select path="signatureMethod">
+                    <form:options items="${oAuthParams.methods}" itemValue="methodName"
+                                  itemLabel="methodName"/>
+                </form:select>
+            </td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <input type="submit" value="Get Temporary Credentials"/>
+            </td>
+        </tr>
+    </table>
+</form:form>
+</body>
+</html>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/views/tokenRequest.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,88 @@
+<!--
+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.
+-->
+<%--@elvariable id="text" type="java.lang.String"--%>
+<%--@elvariable id="oAuthParams" type="org.apache.cxf.auth.oauth.sample.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" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+
+<html>
+<head>
+    <title>OAuth 1.0a Client</title>
+</head>
+<body>
+<table align="center">
+    <tr>
+        <td><h2>Sample OAuth 1.0a client implementation</h2></td>
+    </tr>
+</table>
+<h3>Step 3. Request Access Token</h3>
+
+<form:form commandName="oAuthParams" action="/app/tokenRequest">
+    <c:if test="${!empty oAuthParams.errorMessage}">
+        <font color="red"><p>Error: ${oAuthParams.errorMessage}</p></font>
+    </c:if>
+    <table>
+        <tr>
+            <td>Response:</td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>OAuth Token:</td>
+            <td><form:input type="text" size="70" path="oauthToken"/></td>
+        </tr>
+        <tr>
+            <td>OAuth Verifier:</td>
+            <td><form:input type="text" size="70" path="oauthVerifier"/></td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>&nbsp;</td>
+        </tr>
+        <tr>
+            <td>Required OAuth parameters:</td>
+        </tr>
+        <tr>
+            <td>Token Request URI:</td>
+            <td><form:input size="70" path="tokenRequestEndpoint"/></td>
+        </tr>
+
+        <tr>
+            <td>Client Identifier:</td>
+            <td><form:input size="70" path="clientID"/></td>
+        </tr>
+        <tr>
+            <td>Signature Method:</td>
+            <td>
+                <form:select path="signatureMethod">
+                    <form:options items="${oAuthParams.methods}" itemValue="methodName"
+                                  itemLabel="methodName"/>
+                </form:select>
+            </td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <input type="submit" value="Request Access Token"/>
+            </td>
+        </tr>
+    </table>
+</form:form>
+</body>
+</html>
\ No newline at end of file

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml Wed Jul 14 21:30:17 2010
@@ -0,0 +1,49 @@
+<!--
+  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.
+-->
+<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">
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>/WEB-INF/spring-servlet.xml</param-value>
+    </context-param>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>spring</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>spring</servlet-name>
+        <url-pattern>/app/*</url-pattern>
+    </servlet-mapping>
+
+
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+</web-app>

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/index.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/index.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/client/src/main/webapp/index.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,20 @@
+<!--
+  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.
+-->
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%response.sendRedirect("/app/temporaryCredentials"); %>

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jul 14 21:30:17 2010
@@ -0,0 +1,4 @@
+auth.oauth.demo.iml
+auth.oauth.demo.ipr
+auth.oauth.demo.iws
+target

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml Wed Jul 14 21:30:17 2010
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         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>
+    <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>
+        <version>2.3.0-SNAPSHOT</version>
+        <relativePath>../../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <build>
+        <finalName>oauth_1.0_server</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>maven-jetty-plugin</artifactId>
+                <version>6.1.24</version>
+                <configuration>
+                    <webAppConfig>
+                        <contextPath>/</contextPath>
+                    </webAppConfig>
+                    <connectors>
+                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                            <port>8081</port>
+                            <maxIdleTime>60000</maxIdleTime>
+                        </connector>
+                    </connectors>
+                    <scanIntervalSeconds>10</scanIntervalSeconds>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-rs-oauth</artifactId>
+            <version>${project.version}</version>
+        </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>
+            <version>${project.version}</version>
+        </dependency>
+        <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>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core-tiger</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-taglibs</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <artifactId>standard</artifactId>
+            <groupId>taglibs</groupId>
+            <version>1.1.2</version>
+            <type>jar</type>
+            <scope>runtime</scope>
+        </dependency>
+    </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

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java Wed Jul 14 21:30:17 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.rs.auth.oauth.demo;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.security.AuthenticationException;
+import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
+
+import net.oauth.OAuth;
+
+/**
+ * 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 oauth_token = request.getParameter(OAuth.OAUTH_TOKEN);
+        return new StringBuffer(failureUrl).append("?").append(OAuth.OAUTH_TOKEN).append("=")
+            .append(oauth_token).toString();
+    }
+}

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/OAuthAuthenticationProcessingFilter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/SampleResourceProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/SampleResourceProvider.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/SampleResourceProvider.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/SampleResourceProvider.java Wed Jul 14 21:30:17 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.rs.auth.oauth.demo;
+
+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/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/SampleResourceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java Wed Jul 14 21:30:17 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.rs.auth.oauth.demo;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cxf.auth.oauth.endpoints.ResourceOwnerAuthorizationService;
+import org.springframework.security.Authentication;
+import org.springframework.security.ui.TargetUrlResolver;
+import org.springframework.security.ui.savedrequest.SavedRequest;
+
+import net.oauth.OAuth;
+
+/**
+ * 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 {
+
+    private String confirmationUrl;
+
+    public String determineTargetUrl(final SavedRequest savedRequest,
+                                     final HttpServletRequest currentRequest, final Authentication auth) {
+
+
+        String oauthToken = currentRequest.getParameter(OAuth.OAUTH_TOKEN);
+        String secToken = currentRequest.getParameter(ResourceOwnerAuthorizationService.SEC_TOKEN);
+
+        StringBuffer url = new StringBuffer(confirmationUrl).append("?").append(OAuth.OAUTH_TOKEN).append("=")
+            .append(
+                oauthToken).append("&").append(ResourceOwnerAuthorizationService.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/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/java/org/apache/cxf/rs/auth/oauth/demo/TargetURLResolver.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml Wed Jul 14 21:30:17 2010
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+       xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xsi:schemaLocation="http://cxf.apache.org/configuration/security
+  		      http://cxf.apache.org/schemas/configuration/security.xsd
+            http://cxf.apache.org/transports/http/configuration
+            http://cxf.apache.org/schemas/configuration/http-conf.xsd
+            http://cxf.apache.org/transports/http-jetty/configuration
+            http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+            http://www.springframework.org/schema/beans
+            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+
+    <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-servlet.xml"/>
+    <import resource="classpath:META-INF/cxf/cxf-extension-http.xml"/>
+    <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
+
+
+    <!-- Publish OAuth endpoints-->
+    <jaxrs:server id="oauthServer" address="/oauth/">
+        <jaxrs:serviceBeans>
+            <ref bean="temporaryCredentialService"/>
+            <ref bean="confirmationService"/>
+            <ref bean="tokenService"/>
+        </jaxrs:serviceBeans>
+    </jaxrs:server>
+
+    <jaxrs:server id="oauthAuthorization" address="/oauth/authorize">
+        <jaxrs:serviceBeans>
+            <ref bean="resourceOwnerAuthorizationEndpoint"/>
+        </jaxrs:serviceBeans>
+        <jaxrs:providers>
+            <ref bean="dispatchProvider"/>
+        </jaxrs:providers>
+    </jaxrs:server>
+
+    <!--Redirects from Resource Owner Authorization Endpoint to sign in page-->
+    <bean id="dispatchProvider" class="org.apache.cxf.jaxrs.provider.RequestDispatcherProvider">
+        <property name="resourcePath" value="/login.jsp"/>
+    </bean>
+
+    <!-- Endpoint serves OAuth protected resource -->
+    <jaxrs:server id="resourceServer" address="/resources/">
+        <jaxrs:serviceBeans>
+            <ref bean="resource"/>
+        </jaxrs:serviceBeans>
+        <jaxrs:inInterceptors>
+            <ref bean="oauthSecurityInterceptor"/>
+        </jaxrs:inInterceptors>
+    </jaxrs:server>
+
+    <!-- Resource Provider -->
+    <bean id="resource" class="org.apache.cxf.rs.auth.oauth.demo.SampleResourceProvider"/>
+
+    <!-- Intercept request to OAuth protected resources -->
+    <bean id="oauthSecurityInterceptor"
+          class="org.apache.cxf.auth.oauth.interceptors.OAuthSecurityInterceptor">
+        <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+    </bean>
+
+    <!--OAuth data provider -->
+    <bean id="oauthDataProvider" class="org.apache.cxf.auth.oauth.provider.OAuthDataProviderImpl">
+        <property name="clientAuthInfo">
+            <map key-type="java.lang.String"
+                 value-type="org.apache.cxf.auth.oauth.provider.ClientAuthenticationInfo">
+                <entry key="12345678" value-ref="clientAuthInfo"/>
+            </map>
+        </property>
+    </bean>
+
+    <!--Init OAuth provider with sample data-->
+    <bean id="clientAuthInfo" class="org.apache.cxf.auth.oauth.provider.ClientAuthenticationInfoImpl">
+        <constructor-arg value="12345678"/>
+        <constructor-arg value="secret"/>
+        <constructor-arg value="http://localhost:8080/app/callback"/>
+        <constructor-arg value="OAuth 1.0 sample app"/>
+    </bean>
+
+
+    <!--Definitions of OAuth module endpoints-->
+    <bean id="resourceOwnerAuthorizationEndpoint"
+          class="org.apache.cxf.auth.oauth.endpoints.ResourceOwnerAuthorizationServiceImpl">
+        <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+    </bean>
+
+    <bean id="confirmationService"
+          class="org.apache.cxf.auth.oauth.endpoints.ResourceOwnerAuthorizationConfirmationServiceImpl">
+        <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+    </bean>
+
+    <bean id="tokenService"
+          class="org.apache.cxf.auth.oauth.endpoints.TokenCredentialsServiceImpl">
+        <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+    </bean>
+
+    <bean id="temporaryCredentialService"
+          class="org.apache.cxf.auth.oauth.endpoints.TemporaryCredentialServiceImpl">
+        <property name="oAuthDataProvider" ref="oauthDataProvider"/>
+    </bean>
+</beans>
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/oauth-beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml Wed Jul 14 21:30:17 2010
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+             xmlns:beans="http://www.springframework.org/schema/beans"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
+
+    <!--returns request params from sign in page to confirmation endpoint-->
+    <beans:bean id="oauthTargetURLResolver" class="org.apache.cxf.rs.auth.oauth.demo.TargetURLResolver">
+        <beans:property name="confirmationUrl" value="/auth/oauth/confirm"/>
+    </beans:bean>
+
+
+    <beans:bean id="customAuthenticationProcessingFilter"
+                class="org.apache.cxf.rs.auth.oauth.demo.OAuthAuthenticationProcessingFilter">
+        <custom-filter position="AUTHENTICATION_PROCESSING_FILTER"/>
+        <!--defaultTargetUrl is overwritten by oauthTargetURLResolver for oauth purposes-->
+        <beans:property name="defaultTargetUrl" value="/doesnt/matter"/>
+        <beans:property name="authenticationManager" ref="authenticationManager"/>
+        <beans:property name="authenticationFailureUrl" value="/auth/oauth/authorize"/>
+        <beans:property name="allowSessionCreation" value="true"/>
+        <beans:property name="targetUrlResolver" ref="oauthTargetURLResolver"/>
+    </beans:bean>
+
+
+    <beans:bean id="myAuthenticationEntryPoint"
+                class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
+        <beans:property name="loginFormUrl" value="/login.jsp"/>
+    </beans:bean>
+
+    <http entry-point-ref="myAuthenticationEntryPoint" auto-config="false">
+        <intercept-url pattern="/login.jsp" filters="none"/>
+        <intercept-url pattern="/index.jsp" filters="none"/>
+        <intercept-url pattern="/" filters="none"/>
+        <intercept-url pattern="/auth/oauth/**" filters="none"/>
+        <intercept-url pattern="/auth/resources/**" filters="none"/>
+        <intercept-url pattern="/**" access="ROLE_USER"/>
+
+        <logout invalidate-session="true" logout-url="/logout.htm"
+                logout-success-url="/login.jsp?loggedout=true"/>
+
+    </http>
+
+    <authentication-manager alias="authenticationManager"/>
+    <authentication-provider>
+        <user-service id="userDetailsService">
+            <user name="user1" password="1111" authorities="ROLE_USER"/>
+        </user-service>
+    </authentication-provider>
+</beans:beans>
\ No newline at end of file

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/security-beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml Wed Jul 14 21:30:17 2010
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<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">
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>/WEB-INF/*-beans.xml</param-value>
+    </context-param>
+
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <filter>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <servlet>
+        <servlet-name>CXFServlet</servlet-name>
+        <servlet-class>
+            org.apache.cxf.transport.servlet.CXFServlet
+        </servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>CXFServlet</servlet-name>
+        <url-pattern>/auth/*</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+</web-app>

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/index.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/index.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/index.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+<%--@elvariable id="text" type="java.lang.String"--%>
+<%--@elvariable id="oauthauthorizationdata" type="org.apache.cxf.auth.oauth.provider.OAuthAuthorizationData"--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page isELIgnored="false" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<html>
+<head><title>OAuth 1.0a CXF server</title></head>
+<body>
+<table align="center">
+    <tr align="center">
+        <td><h2>Sample CXF-OAuth 1.0a server implementation</h2></td>
+    </tr>
+
+    <tr align="center">
+        <td><h3>OAuth protected resources at: </h3></td>
+    </tr>
+    <tr align="center">
+        <td><input size="70" value="http://localhost:8081/auth/resources/person/{name}"/><br/><br/>
+        You can access this resources by using OAuth client hosted at: <a href="http://www.oauthclient.appspot.com/">OAuth client</a></td>
+    </tr>
+</table>
+</body>
+</html>

Added: cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/login.jsp
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/login.jsp?rev=964212&view=auto
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/login.jsp (added)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth_demo/server/src/main/webapp/login.jsp Wed Jul 14 21:30:17 2010
@@ -0,0 +1,83 @@
+<!--
+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.
+-->
+<%--@elvariable id="text" type="java.lang.String"--%>
+<%--@elvariable id="oauthauthorizationdata" type="org.apache.cxf.auth.oauth.provider.OAuthAuthorizationData"--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page isELIgnored="false" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<html>
+<head><title>OAuth 1.0a CXF server</title></head>
+<body>
+<table align="center">
+    <tr>
+        <td><h2>Sample CXF-OAuth 1.0a server implementation</h2></td>
+    </tr>
+</table>
+<c:choose>
+    <c:when test="${!empty oauthauthorizationdata.oauthToken && !empty oauthauthorizationdata.securityToken}">
+        <table align="center">
+            <tr align="center">
+                <td><h3>Login with Username and Password</h3></td>
+            </tr>
+
+            <tr>
+                <td>User: user1</td>
+            </tr>
+            <tr>
+                <td>Password: 1111</td>
+            </tr>
+            <tr align="center">
+                <td>
+                    <form name="f" action="/j_spring_security_check" method="POST">
+                        <input type="hidden" name="oauth_token" value="${oauthauthorizationdata.oauthToken}"/>
+                        <input type="hidden" name="sec_token"
+                               value="${oauthauthorizationdata.securityToken}"/>
+
+                        <p>The application <b>${oauthauthorizationdata.applicationName}</b> would like the
+                            ability to access and update your data on Sample OAuth CXF server.
+                            <br/>
+                            Please ensure that you trust this website with your information before
+                            proceeding!</p>
+                        <c:if test="${not empty param.login_error}">
+                            <font color="red">
+                                Your login attempt was not successful, try again.<br/><br/>
+                                Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
+                            </font>
+                        </c:if>
+                        <label for="login">User</label>
+                        <input type="text" id="login" name='j_username'
+                               value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/>
+
+                        <div class="clear"></div>
+                        <label for="password">Password</label>
+                        <input type="password" id="password" name="j_password"/>
+                        <br>
+                        <input type="submit" class="button" name="commit" value="Log in"/>
+                    </form>
+                </td>
+            </tr>
+        </table>
+    </c:when>
+    <c:otherwise>
+        <h3>Invalid request</h3>
+    </c:otherwise>
+</c:choose>
+</body>
+</html>
\ No newline at end of file



Mime
View raw message