Added OpenId Module.

Better way to present handle authentication strategies in the view using tabs.
This commit is contained in:
jvelilla
2015-06-30 16:54:09 -03:00
parent eb9ac980e6
commit 26276dad5d
24 changed files with 1497 additions and 18 deletions

View File

@@ -179,7 +179,7 @@ feature -- Router
a_router.handle ("/account/roc-oauth-login", create {WSF_URI_AGENT_HANDLER}.make (agent handle_login (a_api, ?, ?)), a_router.methods_head_get)
a_router.handle ("/account/roc-oauth-logout", create {WSF_URI_AGENT_HANDLER}.make (agent handle_logout (a_api, ?, ?)), a_router.methods_get_post)
a_router.handle ("/account/login-with-oauth/{callback}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent handle_login_with_oauth (a_api,a_user_oauth_api, ?, ?)), a_router.methods_get_post)
a_router.handle ("/account/{callback}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent handle_callback_oauth (a_api, a_user_oauth_api, ?, ?)), a_router.methods_get_post)
a_router.handle ("/account/oauth-callback/{callback}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent handle_callback_oauth (a_api, a_user_oauth_api, ?, ?)), a_router.methods_get_post)
end
feature -- Hooks configuration
@@ -227,10 +227,11 @@ feature -- Hooks
end
create lnk.make (u.name + " (Logout)", "account/roc-oauth-logout" )
a_menu_system.primary_menu.extend (lnk)
end
if a_response.location.starts_with ("account/roc-login") then
create lnk.make ("OAuth", "account/roc-oauth-login")
a_response.add_to_primary_tabs (lnk)
else
if a_response.location.starts_with ("account/") then
create lnk.make ("OAuth", "account/roc-oauth-login")
a_response.add_to_primary_tabs (lnk)
end
end
end

View File

@@ -20,7 +20,7 @@ feature {NONE} -- Initialization
do
initilize (a_consumer)
create config.make_default (a_consumer.api_key, a_consumer.api_secret)
config.set_callback (a_host + "/account/"+ a_consumer.callback_name)
config.set_callback (a_host + "/account/oauth-callback"+ a_consumer.callback_name)
config.set_scope (a_consumer.scope)
--Todo create a generic OAUTH_20_GENERIC_API
create oauth_api.make (a_consumer.endpoint, a_consumer.authorize_url, a_consumer.extractor)