summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJozef Kutej <jozef@kutej.net>2008-12-01 23:46:10 +0100
committerJozef Kutej <jozef@kutej.net>2008-12-01 23:46:10 +0100
commit44fc2e9438562c631b3fa5290bc5a5e988ce6750 (patch)
tree2366d3ca278f4fbefb9d95ba00b4a83c9bec0fac
parentbad bad (diff)
parentMerge branch 'master' of git@git.useperl.at:PAUSE-OpenID (diff)
downloadSimple-OpenID-44fc2e9438562c631b3fa5290bc5a5e988ce6750.tar.gz
Simple-OpenID-44fc2e9438562c631b3fa5290bc5a5e988ce6750.tar.bz2
Simple-OpenID-44fc2e9438562c631b3fa5290bc5a5e988ce6750.zip
Merge branch 'master' of git@git.useperl.at:PAUSE-OpenID
-rw-r--r--lib/PAUSE/OpenID/Controller/Root.pm13
-rw-r--r--pause_openid.pl2
-rw-r--r--pause_openid_local.pl2
-rw-r--r--root/templates/index.xsl2
4 files changed, 12 insertions, 7 deletions
diff --git a/lib/PAUSE/OpenID/Controller/Root.pm b/lib/PAUSE/OpenID/Controller/Root.pm
index 221955f..cfbc608 100644
--- a/lib/PAUSE/OpenID/Controller/Root.pm
+++ b/lib/PAUSE/OpenID/Controller/Root.pm
@@ -31,14 +31,19 @@ PAUSE::OpenID::Controller::Root - Root Controller for PAUSE::OpenID
sub index :Path :Args(0) {
my ( $self, $c ) = @_;
- if ( not defined $c->req->param('openid.return_to') ) {
+ # 5.2.3
+ # If the malformed or invalid message is received by the Relying Party, or "openid.return_to"
+ # is not present or its value is not a valid URL, the server SHOULD return a response to the end user
+ # indicating the error and that it is unable to continue.
+ my $return_to = $c->req->param('openid.return_to');
+ # TODO: check if its a valid URL
+ if ( not defined $return_to ) {
#$c->flash->{xml} = '<document><error_message>Missing parameter</error_message></document>';
$c->res->redirect($c->uri_for('/error'));
}
-$c->stash->{xml} =<<XML;
-<document/>
-XML
+ # TODO: generate XML programatically
+ $c->stash->{xml} = sprintf('<document><config key="url" value="%s"/></document>', $c->config->{'PAUSE::OpenID'}{'baseurl'});
# Pass through parameters (unchecked for now)
foreach my $key ( keys %{$c->req->params} ) {
diff --git a/pause_openid.pl b/pause_openid.pl
index 6604d9b..0cf7b2e 100644
--- a/pause_openid.pl
+++ b/pause_openid.pl
@@ -23,7 +23,7 @@ return {
},
'PAUSE::OpenID'=>{
- hostname=>'id.pause.org',
+ baseurl=>'https://id.pause.org/',
},
'ssl' => {
diff --git a/pause_openid_local.pl b/pause_openid_local.pl
index b823bbe..0176434 100644
--- a/pause_openid_local.pl
+++ b/pause_openid_local.pl
@@ -4,7 +4,7 @@ use warnings;
# Returnvalue
return {
'PAUSE::OpenID'=>{
- hostname=>'localhost',
+ baseurl=>'http://localhost:3000/',
},
};
diff --git a/root/templates/index.xsl b/root/templates/index.xsl
index 9dc5bd4..6b83e4b 100644
--- a/root/templates/index.xsl
+++ b/root/templates/index.xsl
@@ -13,7 +13,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sign in with OpenID</title>
- <link rel="openid.server" href="https://localhost/openid" />
+ <link rel="openid.server" href="{config[@key='baseurl']/@value}/openid" />
<style type="text/css">
@import "default.css";
</style>