Did you know ... Search Documentation:
openid.pl -- Handle users of the SWI-Prolog website
PublicShow source

This module provide the OpenID interface for the SWI-Prolog website. If you want to run this for local installations, make sure that your server is accessible through the public network and first direct your browser to the public network. Logging in using Google should work than. Some other providers have more strict requirements.

You can fake OpenID login using the debug interface:

?- debug(openid_fake('WouterBeek')).
Source grant(+User, +Token) is det
Source revoke(+User, +Token) is det
Grant/revoke User (a UUID) the right to access Token.
Source grant_user(+Request)[private]
HTTP handler to grant or revoke rights for a user.
Source authenticate(+Request, +Token, -Fields)
Get authentication for editing wiki pages. This now first tries the OpenID login.
Source site_user(+Request, -User)
Demand the user to be logged on and, if this is the first logon, verify the user and create a profile.
Source site_user_logged_in(-User) is semidet
True when User is logged on. Does not try to logon the user.
Source create_profile(+Request)[private]
Create a new user profile, and on success return to the original location.
Source description(+UUID)//[private]
Provide field for entering a description about the user.
Source submit_profile(+Request)[private]
Handle submission of the user profile
Source view_profile(+Request) is det[private]
HTTP handler showing the public profile for a user. Viewing options:
Requested user is logged on[view(private), edit_link(true)]
Logged on is admin[view(admin)]
Not logged on[view(public)
Source private_profile(+UUID, +Options)// is det[private]
If the user is viewing his/her own profile or the logged on user has admin rights, show a table holding the private profile information.
Source user_description(UUID, +Options)// is det[private]
Show user description
Source user_packs(UUID)// is det[private]
Show a filtered version of the pack table, holding the packs created by this user.
Source list_users(+Request)[private]
HTTP handler to list known users.
Source user_profile_link(+UUID)//
Create a link to the profile of a user.
Source yadis:xrds_specified_location(+Server, -XRDSLocation)[multifile]
Hacks to deal with broken Yadis support.
  • Google does not support Yadis discovery, but does have an XRSD document, so we fake its location.
  • stackexchange.com serves an OP Identifier Element instead of an Claimed Identifier Element when doing Yadis discovery on the real OpenID.
Source plweb_login_page(+Request)[private]
HTTP handler that overrules the location openid(login) for customizating the -very basic- login page.
Source quick_buttons(-Buttons) is det[private]
Create a list of img(Attributes) terms for quick login.
Source verify_user(+Request)[private]
HTTP handler for SWI-Prolog site login. Calls openid_verify, asking for additional attribute exchange.
Source login_with_google(+Request)[private]
HTTP handler to login with Google.
Source google_client:login_existing_user(+Claim) is semidet[multifile]
True if the user is know to us and thus we can perform the login without further interaction.
Source google_client:create_user(+Profile) is det[multifile]
Create a new user for the given Google Profile.
Source logout(+Request)[private]
Logout the current user. If openid.return_to is provided, provide a back-link
Source current_user//
Source login_link(+Request)//
Create a link to login, which returns to the current page.
Source logout_link//[private]
Create a link to logout
Source redirect_master(+Request)
Redirect a request to the master server, so we do not have to deal with multiple versions of the database files.

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source grant(+User, +Token) is det
Source revoke(+User, +Token) is det
Grant/revoke User (a UUID) the right to access Token.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source current_user(Arg1, Arg2, Arg3)
Source site_user_property(Arg1, Arg2)