Skip to content

jcleblanc/openid-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenID Sample Code

The sample code contained in this project is intended to be used to integrate support for OpenID on an external website. This project contains several files that are required for integration:

  • index.html – The form to initiate the OpenID request
  • auth.php – Performs the discovery and authorization of the user
  • complete.php – Completion page following the user authorization
  • includes.php – Common configuration URLs, file locations and functions. URLS AND FILE LOCATIONS NEED TO BE UPDATED WITH YOUR OWN FILES AND URLS.
  • xrds.php – The XRDS file to validate your domain during OpenID domain discovery to avoid warning messages. See “Setting up your XRDS File” section for full details.

Library Dependancies

This sample code requires the 2.×.x version of the PHP OpenID library to function. Please download this library from http://openidenabled.com/php-openid/. Within the archive is a folder titled “Auth” – copy this folder at the same level as the files in this project.

Setting Up Your XRDS File

This section will guide you through the setup of your XRDS file. This file is intended to bypass messages provided during authentication stating that your OpenID site’s identity is not confirmed, as described at http://blog.nerdbank.net/2008/06/why-yahoo-says-your-openid-site.html.

To complete this integration, the following steps must be iterated upon:

  • Edit the <URI> node in the xrds.php file to point to the complete.php file on your server
  • Copy the xrds.php file to your website
  • On the root page served up by your domain (e.g. /index.html) add a meta tag in the head to link to the xrds file you just uploaded. This meta tag will look like <meta http-equiv=“X-XRDS-Location” content=“http://www.mydomain.com/xrds.php”/>
  • Your domain should should now be discoverable through the OpenID process.

Code Contributions

This project only accepts contributions licensed under the BSD open source license. See the Open Source Initiative’s approved template below.

Each file submitted should contain the following information in the header:
// Created by Jonathan LeBlanc
// Copyright © Jonathan LeBlanc, 2010. All Rights Reserved.
// Licensed under the BSD (revised) open source license.

Below is the Open Source Initiative BSD License Template (http://opensource.org/licenses/bsd-license.php):

Copyright © <2010>, <Jonathan LeBlanc>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

OpenID PHP Sample Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages