icon OpenID
Created by Orckestra

How to implement OpenID on a website

To force users to sign in with OpenID to view pages or content on them:

  1. Set up an OpenID-based sign-in form on the website
  2. Add OpenID protection from anonymous access to pages or selected content on pages.

Additionally, you can:

  • Set up the user profile information page.
  • Have the sign-in status displayed on protected pages

Please note that implementing OpenID on pages / selected content on pages only protects from anonymous access. Each user with a valid OpenID or an account with one of the OpenID providers (Google, Yahoo etc) will still be able to sign in and view the content.

Setting up an OpenID sign-in form

  1. In the Content perspective, create or edit a page to have an OpenID based sign-in form.
  2. Insert the Composite.Community.OpenID.SignInForm function ( Insert > Function) or add the following markup:
    Expand code
  3. If necessary, set its optional parameter:
    • User Details Page: The page with a User Details form (user profile information allowed by the OpenID provider)

Protecting pages

To protect multiple pages based on the same template or an individual page from anonymous access:

  1. In the Layout perspective, edit a template or in the Content perspective, edit a page.
  2. Insert the Composite.Community.OpenID.PageProtection function ( Insert > Function) or add the following markup:
    Expand code
  3. Set the Sign In Page parameter to the page with the sign-in form.

Protecting content on pages

To protect some content on a page:

  1. In the Content perspective, edit a page.
  2. Insert the Composite.Community.OpenID.ContentProtection function ( Insert > Function) or add the following markup:
    Expand code
  3. Set its required parameters:
    • Sign In Page: The page with an OpenID sign-in form.
    • Content To Protect: The content to protect on a page.
  4. If necessary, set its optional parameter:
    • Message: The message to display to the user who has not signed in when not redirected. "This is a protected page. To continue, please" by default (followed by the URL to the sign-in page).

Displaying user profile information

  1. In the Content perspective, create or edit a page for user profile information.
  2. Insert the Composite.Community.OpenID.UserDetailsForm function ( Insert > Function) or add the following markup:
    Expand code
  3. Set its required parameter:
    • Sign In Page: The page with an OpenID sign-in form.

Displaying user sign-in status on pages

  1. In the Layout perspective, edit the templates used by protected pages or pages with protected content.
  2. Add the Composite.Community.OpenID.SignInStatus function ( Insert > Function) or insert the following code:
    Expand code
  3. Set the required parameters:
    • Sign In Page: The page with an OpenID sign-in form
    • User Details page: The page with a User Details form (user profile information allowed by the OpenID provider)