diff options
Diffstat (limited to '')
4 files changed, 235 insertions, 0 deletions
diff --git a/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/index.html b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/index.html new file mode 100644 index 0000000000..98bbac0c57 --- /dev/null +++ b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/index.html @@ -0,0 +1,46 @@ +<!-- + 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. +--> + +<html> +<head> +<script type="text/javascript" src="/component.js"></script> +<script type="text/javascript"> +var protected = sca.component("Protected"); +var userInfo = sca.defun(sca.reference(protected, "userInfo"), "getuser", "getemail", "getrealm"); +var user = userInfo.getuser(); +var email = userInfo.getemail(); +var realm = userInfo.getrealm(); +</script> +</head> +<body> +<h1>Protected area - It works!</h1> +<p>The following info is returned by a JSONRPC service:</p> +<div id="user"></div> +<div id="email"></div> +<div id="realm"></div> +<script type="text/javascript"> +document.getElementById('user').innerHTML="User: " + user; +document.getElementById('email').innerHTML="Email: " + email; +document.getElementById('realm').innerHTML="Realm: " + realm; +</script> +<p><a href="info">User info</a></p> +<p><a href="login">Sign in</a></p> +<p><a href="logout">Sign out</a></p> +<p><a href="public">Public area</a></p> +</body></html> diff --git a/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/login/index.html b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/login/index.html new file mode 100644 index 0000000000..493227addc --- /dev/null +++ b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/login/index.html @@ -0,0 +1,129 @@ +<!-- + 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. +--> + +<html><body><h1>Sign in with an OpenID provider</h1> + +<script type="text/javascript"> +function queryParams() { + qp = new Array(); + qs = window.location.search.substring(1).split('&'); + for (i = 0; i < qs.length; i++) { + e = qs[i].indexOf('='); + if (e > 0) + qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1)); + } + return qp; +} + +function openidReferrer() { + r = queryParams()['openauth_referrer']; + if (typeof(r) == 'undefined') + return r; + q = r.indexOf('?'); + if (q > 0) + return r.substring(0, q); + return r; +} + +if (typeof(openidReferrer()) == 'undefined') { + document.location = '/'; +} + +function submitSignin(w) { + document.cookie = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';path=/;secure=TRUE'; + document.signin.openid_identifier.value = w(); + document.signin.action = openidReferrer(); + document.signin.submit(); +} + + +function withGoogle() { + return 'https://www.google.com/accounts/o8/id'; +} + +function withYahoo() { + return 'https://me.yahoo.com/'; +} + +function withMyOpenID() { + return 'http://www.myopenid.com/xrds'; +} + +function withVerisign() { + return 'https://pip.verisignlabs.com/'; +} + +function withMySpace() { + return 'https://api.myspace.com/openid'; +} + +function withGoogleApps() { + return 'https://www.google.com/accounts/o8/site-xrds?ns=2&hd=' + document.fields.domain.value; +} + +function withLivejournal() { + return 'http://' + document.fields.ljuser.value + '.livejournal.com'; +} + +function withBlogspot() { + return 'http://' + document.fields.bsuser.value + '.blogspot.com'; +} + +function withBlogger() { + return 'http://' + document.fields.bguser.value + '.blogger.com'; +} + +function withXRDSEndpoint() { + return document.fields.endpoint.value; +} +</script> + +<form name="signin" action="/" method="GET"> +<input type="hidden" name="openid_identifier" value="https://www.google.com/accounts/o8/id"/> +</form> + +<form name="fields"> +<p>Sign in with your Google account<br/><input type="button" onclick="submitSignin(withGoogle)" value="Sign in"/></p> +<p>Sign in with your Yahoo account<br/><input type="button" onclick="submitSignin(withYahoo)" value="Sign in"/></p> +<p>Sign in with your MyOpenID account<br/><input type="button" onclick="submitSignin(withMyOpenID)" value="Sign in"/></p> +<p>Sign in with your Verisign account<br/><input type="button" onclick="submitSignin(withVerisign)" value="Sign in"/></p> +<p>Sign in with your MySpace account<br/><input type="button" onclick="submitSignin(withMySpace)" value="Sign in"/></p> + +<p>Sign in with a Google apps domain<br/> +<input type="text" size="20" name="domain" value="example.com"/><br/> +<input type="button" onclick="submitSignin(withGoogleApps)" value="Sign in"/></p> + +<p>Sign in with your Livejournal account<br/> +<input type="text" size="10" name="ljuser" value=""/><br/> +<input type="button" onclick="submitSignin(withLivejournal)" value="Sign in"/></p> + +<p>Sign in with your Blogspot account<br/> +<input type="text" size="10" name="bsuser" value=""/><br/> +<input type="button" onclick="submitSignin(withBlogspot)" value="Sign in"/></p> + +<p>Sign in with your Blogger account<br/> +<input type="text" size="10" name="bguser" value=""/><br/> +<input type="button" onclick="submitSignin(withBlogger)" value="Sign in"/></p> + +<p>Sign in with an OpenID endpoint<br/> +<input type="text" size="50" name="endpoint" value="https://www.google.com/accounts/o8/id"/><br/> +<input type="button" onclick="submitSignin(withXRDSEndpoint)" value="Sign in"/></p> +</form> + +</body></html> diff --git a/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/logout/index.html b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/logout/index.html new file mode 100644 index 0000000000..02a92d1b31 --- /dev/null +++ b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/logout/index.html @@ -0,0 +1,33 @@ +<!-- + 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. +--> + +<html><body> +<h1>Sign out</h1> + +<form name="signout" action="/login" method="GET"> +<script type="text/javascript"> +function submitSignout() { + document.cookie = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';path=/;secure=TRUE'; + document.signout.submit(); + return true; +} +</script> +<input type="button" onclick="submitSignout()" value="Sign out"/> +</form> +</body></html> diff --git a/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/public/index.html b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/public/index.html new file mode 100644 index 0000000000..af2cd7ca19 --- /dev/null +++ b/sandbox/sebastien/cpp/apr-2/modules/openid/htdocs/public/index.html @@ -0,0 +1,27 @@ +<!-- + 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. +--> + +<html> +<body> +<h1>Unprotected area - It works!</h1> +<p><a href="/info">User info</a></p> +<p><a href="/login">Sign in</a></p> +<p><a href="/logout">Sign out</a></p> +<p><a href="/">Protected area</a></p> +</body></html> |