From 8e35575af73a89217bc5f9dc14dd59428f5ee39a Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 1 Jul 2010 06:04:43 +0000 Subject: Refactor OpenID test pages and add test methods returning the user info. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@959522 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/openid/Makefile.am | 4 +- sca-cpp/trunk/modules/openid/htdocs/index.html | 3 +- sca-cpp/trunk/modules/openid/htdocs/login.html | 62 -------------- .../modules/openid/htdocs/protected/index.html | 23 ++++- .../openid/htdocs/protected/login/index.html | 97 ++++++++++++++++++++++ .../modules/openid/htdocs/protected/logout.html | 34 -------- .../openid/htdocs/protected/logout/index.html | 34 ++++++++ sca-cpp/trunk/modules/openid/openid-conf | 23 ++++- sca-cpp/trunk/modules/openid/openid.composite | 17 ++-- sca-cpp/trunk/modules/openid/server-test | 40 --------- sca-cpp/trunk/modules/openid/server-test.scm | 21 ----- sca-cpp/trunk/modules/openid/start-test | 31 +++++++ sca-cpp/trunk/modules/openid/stop-test | 22 +++++ sca-cpp/trunk/modules/openid/user-info.scm | 26 ++++++ 14 files changed, 266 insertions(+), 171 deletions(-) delete mode 100644 sca-cpp/trunk/modules/openid/htdocs/login.html create mode 100644 sca-cpp/trunk/modules/openid/htdocs/protected/login/index.html delete mode 100644 sca-cpp/trunk/modules/openid/htdocs/protected/logout.html create mode 100644 sca-cpp/trunk/modules/openid/htdocs/protected/logout/index.html delete mode 100755 sca-cpp/trunk/modules/openid/server-test delete mode 100644 sca-cpp/trunk/modules/openid/server-test.scm create mode 100755 sca-cpp/trunk/modules/openid/start-test create mode 100755 sca-cpp/trunk/modules/openid/stop-test create mode 100644 sca-cpp/trunk/modules/openid/user-info.scm (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/modules/openid/Makefile.am b/sca-cpp/trunk/modules/openid/Makefile.am index 90ca3f1f6c..a28611dc41 100644 --- a/sca-cpp/trunk/modules/openid/Makefile.am +++ b/sca-cpp/trunk/modules/openid/Makefile.am @@ -25,8 +25,8 @@ mod_DATA = openid.prefix openid.prefix: $(top_builddir)/config.status echo ${MODAUTHOPENID_PREFIX} >openid.prefix -EXTRA_DIST = openid.composite server-test.scm htdocs/index.html htdocs/login.html htdocs/protected/index.html +EXTRA_DIST = openid.composite user-info.scm htdocs/index.html htdocs/login/index.html htdocs/logout/index.html htdocs/protected/index.html -dist_noinst_SCRIPTS = server-test +dist_noinst_SCRIPTS = start-test stop-test endif diff --git a/sca-cpp/trunk/modules/openid/htdocs/index.html b/sca-cpp/trunk/modules/openid/htdocs/index.html index ff69115cda..1134201389 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/index.html @@ -20,5 +20,6 @@

Unprotected area - It works!

Protected area

-

Sign in

+

Sign in

+

Sign out

diff --git a/sca-cpp/trunk/modules/openid/htdocs/login.html b/sca-cpp/trunk/modules/openid/htdocs/login.html deleted file mode 100644 index b7b87aac04..0000000000 --- a/sca-cpp/trunk/modules/openid/htdocs/login.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -

Sign in with an OpenID provider

- -
- - -
- -
- - - -
- -
- - -
- -
- - -
- -
- - -
- - -
- -
- -
- -
- diff --git a/sca-cpp/trunk/modules/openid/htdocs/protected/index.html b/sca-cpp/trunk/modules/openid/htdocs/protected/index.html index 1799bc1006..4c7bc4f5a3 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/protected/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/protected/index.html @@ -17,8 +17,25 @@ under the License. --> - + + + + + +

Protected area - It works!

-

Hello component

-

Sign out

+

The following info is returned by a JSONRPC service:

+
+
+

User info

+

Sign out

+ diff --git a/sca-cpp/trunk/modules/openid/htdocs/protected/login/index.html b/sca-cpp/trunk/modules/openid/htdocs/protected/login/index.html new file mode 100644 index 0000000000..a3c0119839 --- /dev/null +++ b/sca-cpp/trunk/modules/openid/htdocs/protected/login/index.html @@ -0,0 +1,97 @@ + + +

Sign in with an OpenID provider

+ + + +
+ +
+ +
+

Sign in with your Google account

+

Sign in with your Yahoo account

+

Sign in with your MyOpenID account

+

Sign in with your Verisign account

+

Sign in with a Google apps domain
+
+

+

Sign in with an OpenID endpoint
+
+

+
+ + diff --git a/sca-cpp/trunk/modules/openid/htdocs/protected/logout.html b/sca-cpp/trunk/modules/openid/htdocs/protected/logout.html deleted file mode 100644 index ec8c104c92..0000000000 --- a/sca-cpp/trunk/modules/openid/htdocs/protected/logout.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -

Sign out

- -
- - -
- diff --git a/sca-cpp/trunk/modules/openid/htdocs/protected/logout/index.html b/sca-cpp/trunk/modules/openid/htdocs/protected/logout/index.html new file mode 100644 index 0000000000..a92bad3086 --- /dev/null +++ b/sca-cpp/trunk/modules/openid/htdocs/protected/logout/index.html @@ -0,0 +1,34 @@ + + + +

Sign out

+ +
+ + +
+ diff --git a/sca-cpp/trunk/modules/openid/openid-conf b/sca-cpp/trunk/modules/openid/openid-conf index cac75549fd..5085d741cc 100755 --- a/sca-cpp/trunk/modules/openid/openid-conf +++ b/sca-cpp/trunk/modules/openid/openid-conf @@ -30,11 +30,30 @@ LoadModule authopenid_module $openid_prefix/modules/mod_auth_openid.so AuthOpenIDEnabled On -AuthOpenIDLoginPage /login.html +AuthOpenIDCookiePath / +AuthOpenIDLoginPage /protected/login AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email - + +AuthOpenIDEnabled On +AuthOpenIDCookiePath / +AuthOpenIDLoginPage /protected/login +AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email + + + +AuthOpenIDEnabled On +AuthOpenIDCookiePath / +AuthOpenIDLoginPage /protected/login +AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email + + + +AuthOpenIDEnabled Off + + + AuthOpenIDEnabled Off diff --git a/sca-cpp/trunk/modules/openid/openid.composite b/sca-cpp/trunk/modules/openid/openid.composite index 7310661dc0..6c829c44b1 100644 --- a/sca-cpp/trunk/modules/openid/openid.composite +++ b/sca-cpp/trunk/modules/openid/openid.composite @@ -22,13 +22,18 @@ targetNamespace="http://tuscany.apache.org/xmlns/sca/components" name="openid"> - - - - + + + + + + + + + - nobody - nobody@nowhere.org + anonymous + anonymous@example.com diff --git a/sca-cpp/trunk/modules/openid/server-test b/sca-cpp/trunk/modules/openid/server-test deleted file mode 100755 index f0df198901..0000000000 --- a/sca-cpp/trunk/modules/openid/server-test +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# 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. - -# Setup -../../modules/http/httpd-conf tmp localhost 8090 htdocs -../../modules/server/server-conf tmp -../../modules/server/scheme-conf tmp -./openid-conf tmp htdocs -cat >>tmp/conf/httpd.conf </dev/null -rc=$? - -# Cleanup -#../../modules/http/httpd-stop tmp -#sleep 2 -return $rc diff --git a/sca-cpp/trunk/modules/openid/server-test.scm b/sca-cpp/trunk/modules/openid/server-test.scm deleted file mode 100644 index 19f914b5ce..0000000000 --- a/sca-cpp/trunk/modules/openid/server-test.scm +++ /dev/null @@ -1,21 +0,0 @@ -; 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. - -; OpenID support test case - -(define (get id user email) (list "text/html" (list "

Hello " (user) ", " (email) "

"))) - diff --git a/sca-cpp/trunk/modules/openid/start-test b/sca-cpp/trunk/modules/openid/start-test new file mode 100755 index 0000000000..eed21f759c --- /dev/null +++ b/sca-cpp/trunk/modules/openid/start-test @@ -0,0 +1,31 @@ +#!/bin/sh + +# 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. + +# Setup +../../modules/http/httpd-conf tmp localhost 8090 htdocs +../../modules/server/server-conf tmp +../../modules/server/scheme-conf tmp +./openid-conf tmp htdocs +cat >>tmp/conf/httpd.conf <

The following info is generated on the server:

User: " (user) "
Email: " (email) "
"))) + +(define (getuser user email) (user)) + +(define (getemail user email) (email)) + -- cgit v1.2.3