• Publicity: Public Only All

authorize-procs.tcl

Support for oauth authorization API

This file defines the following Objects and Classes: ::xo::Authorize[i], ::xo::oauth::GitHub[i], ::xo::Authorize[i], ::xo::oauth::GitHub[i]

Location:
packages/xooauth/tcl/authorize-procs.tcl
Author:
Gustaf Neumann

Procedures in this file

Detailed information

Class ::xo::Authorize (public)

 ::nx::Class ::xo::Authorize[i]

Base class to support OAuth authorization API

Partial Call Graph (max 5 caller/called nodes):
%3 ad_user_login ad_user_login (public) apm_package_installed_p apm_package_installed_p (public) auth::authority::local auth::authority::local (public) auth::create_local_account auth::create_local_account (public) db_dml db_dml (public) Class ::xo::Authorize Class ::xo::Authorize Class ::xo::Authorize->ad_user_login Class ::xo::Authorize->apm_package_installed_p Class ::xo::Authorize->auth::authority::local Class ::xo::Authorize->auth::create_local_account Class ::xo::Authorize->db_dml

Testcases:
No testcase defined.

Class ::xo::oauth::GitHub (public)

 ::nx::Class ::xo::oauth::GitHub[i]

Tailored OAuth handler for GitHub

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::Authorize method login_url (public)

 <instance of xo::Authorize[i]> login_url [ -return_url return_url ] \
    [ -login login ]

Returns the URL for log-in

Switches:
-return_url
(optional)
-login
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 export_vars export_vars (public) xo::Authorize instproc login_url xo::Authorize instproc login_url xo::Authorize instproc login_url->export_vars

Testcases:
No testcase defined.

xo::Authorize method logout (public)

 <instance of xo::Authorize[i]> logout

Perform logout operation from oauth in the background (i.e. without a redirect) when the logout_url is nonempty.

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::Authorize method name (public)

 <instance of xo::Authorize[i]> name
Returns:
instance name

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::Authorize method perform_login (public)

 <instance of xo::Authorize[i]> perform_login [ -token token ] \
    [ -state state ]

Get the provided claims from the identity provider and perform an OpenACS login, when the user exists. In case the user does not exist, create it optionally (when "create_not_registered_users" is activated. When the user is created, and dotlrn is installed, the new user might be added optionally as a dotlrn user with the role as specified in "create_with_dotlrn_role".

Switches:
-token
(optional)
-state
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_user_login ad_user_login (public) xo::Authorize instproc perform_login xo::Authorize instproc perform_login xo::Authorize instproc perform_login->ad_user_login

Testcases:
No testcase defined.

xo::oauth::GitHub method get_user_data (public)

 <instance of xo::oauth::GitHub[i]> get_user_data [ -token token ] \
    [ -required_fields required_fields ]

Get user data based on the temporary code (passed via "-token") provided by GitHub. First, convert the temporary code into an access_token, and use this to get the user data.

Switches:
-token
(optional)
-required_fields
(defaults to " {email email} {name name} ") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::oauth::GitHub method logout_url (public)

 <instance of xo::oauth::GitHub[i]> logout_url \
    [ -return_url return_url ]

Returns the URL for logging out. E.g., GitHub has no logout, so provide simply a redirect URL (maybe, we should logout from the application?)

Switches:
-return_url
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
[ show source ]