OpenID consumer implementation

REQUIRES EiffelStudio 7.2
This commit is contained in:
Jocelyn Fiat
2013-02-27 22:13:31 +01:00
parent d4091a57c9
commit 69a77dc2c5
15 changed files with 13 additions and 52 deletions

View File

@@ -1,31 +0,0 @@
note
description : "Objects that ..."
author : "$Author$"
date : "$Date$"
revision : "$Revision$"
class
APPLICATION
inherit
ARGUMENTS
create
make
feature {NONE} -- Initialization
make
-- Initialize `Current'.
do
test_openid
end
test_openid
local
t: TEST_OPENID
do
create t.make
end
end

View File

@@ -1,69 +0,0 @@
note
description: "Summary description for {TEST_OPENID}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
TEST_OPENID
create
make
feature
make
local
o: OPENID_CONSUMER
v: OPENID_CONSUMER_VALIDATION
id: READABLE_STRING_8
do
id := "https://www.google.com/accounts/o8/id"
create o.make ("http://localhost")
if attached o.auth_url (id) as l_url then
check o.error = Void end
get_openid_response_uri (l_url)
if attached openid_response_uri as u and then u.is_valid then
create v.make_from_uri (o, u)
v.validate
if v.is_valid then
print ("Succeed ...%N")
else
print ("Failed !!!%N")
end
else
print ("Failed !!!%N")
end
elseif attached o.error as l_err then
print (l_err)
else
print ("???")
end
end
get_openid_response_uri (a_auth_url: READABLE_STRING_8)
local
f: RAW_FILE
e: EXECUTION_ENVIRONMENT
do
openid_response_uri := Void
create f.make_create_read_write ("openid_tmp.html")
f.put_string ("<a href=%"" + a_auth_url + "%">Click to authenticate with openid</a>")
f.put_new_line
f.close
create e
e.system ("start " + f.name)
io.put_string ("Returned URL (copy/paste the url from your browser's address bar )?%N")
io.read_line
create openid_response_uri.make_from_string (io.last_string)
end
openid_response_uri: detachable URI
feature -- Access
end

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="tests" uuid="A36A6621-CF4A-4FB6-8CB2-D420D630A134">
<target name="tests">
<root class="APPLICATION" feature="make"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<setting name="concurrency" value="none"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="openid" location="..\openid-safe.ecf" readonly="false"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf"/>
<tests name="src" location=".\" recursive="true"/>
</target>
</system>