Skip to content

Commit

Permalink
[project @ Updated the examples usage documentation and moved docs ou…
Browse files Browse the repository at this point in the history
…t of root README]
  • Loading branch information
tailor committed Feb 23, 2006
1 parent 15135b3 commit 7c89c27
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 31 deletions.
28 changes: 2 additions & 26 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,8 @@ TESTING YOUR SETUP
==================

We recommend that you use our example code to test your setup. To run
the example consumer, follow these steps:

1. Check to be sure that /tmp is in your "open_basedir" configuration,
if open_basedir is being used to restrict PHP's file I/O. See
http://us2.php.net/features.safe-mode for more information. For
example, in your php.ini, change

open_basedir = "..."

to

open_basedir = "/tmp:..."

(If you really don't want to add /tmp to your open_basedir, you can
modify examples/consumer/common.php and change $store_path so it
doesn't create the store directory in /tmp.)

2. Copy or symlink the examples/consumer directory into a part of your
webserver's docroot. For example, if your DocumentRoot is
/var/www/, do this:

# cd /var/www
# ln -s /path/to/PHP-OpenID-X.Y.Z/examples/consumer consumer

3. Navigate to http://www.example.com/consumer and enter an OpenID
into the form presented there and click "Verify".
the example consumer, follow the instructions in the examples/README
file.

USING THE API
=============
Expand Down
102 changes: 97 additions & 5 deletions examples/README
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
OpenID Example Code
-------------------

To try the example consumer implementation (which is probably what you
want), just copy the consumer/ directory into a place on your web
server and point your browser at the new directory. (Be sure that the
'Auth' directory included in this package is installed in your PHP
include_path.)
After you've installed this package (see ../README), you can use these
example packages to get started. They'll show you what this package
can do, and you can use them as the basis for your own OpenID support.

consumer/: OpenID Example Consumer
==================================

To try the example consumer implementation, just copy the consumer/
directory into a place on your web server and point your browser at
the new directory.

1. Check to be sure that /tmp is in your "open_basedir" configuration,
if open_basedir is being used to restrict PHP's file I/O. See
http://us2.php.net/features.safe-mode for more information. For
example, in your php.ini, change

open_basedir = "..."

to

open_basedir = "/tmp:..."

(If you really don't want to add /tmp to your open_basedir, you can
modify consumer/common.php and change $store_path so it doesn't
create the store directory in /tmp.)

2. Copy or symlink the consumer/ directory into a part of your
webserver's docroot. For example, if your DocumentRoot is
/var/www/, do this:

# cd /var/www
# ln -s /path/to/PHP-OpenID-X.Y.Z/examples/consumer

3. Navigate to http://www.example.com/consumer and enter an OpenID
into the form presented there and click "Verify".

consumer/ Files
===============

The 'index.php' file will render a form and get you started. These
are the example consumer files:
Expand All @@ -24,3 +57,62 @@ successful.

consumer/common.php - Includes the setup code you'll need to create
a Consumer object and participate in an OpenID authentication.

server/: OpenID Example Server
==============================

To try the example server, follow these steps:

1. Customize server/config.php based on what your PHP installation
supports. The documentation in the file describes what each value
is for.

2. Copy or symlink the server/ directory into a part of your
webserver's docroot. For example, if your DocumentRoot is
/var/www/, do this:

# cd /var/www
# ln -s /path/to/PHP-OpenID-X.Y.Z/examples/server

3. For each of the identity URLs you added to the $openid_users array
in config.php, add the following to the <HEAD> tag of the pages at
those URLs:

<link rel="openid.server" href="http://www.example.com/server/server.php" />

Where "www.example.com/server" is the path to the server symlink
that you created in step (2).

4. Navigate to http://www.example.com/server and click the "Log In"
link to test the OpenID(s) entered into the config file.

5. Use the OpenID checkup tool to try authenticating with your OpenID:

http://www.openidenabled.com/resources/openid-test/checkup

If your OpenID server isn't on the public internet, you can use the
example consumer packaged with this library. See the consumer
section above.

server/ Files
=============

These files make up the server example code:

config.php - The configuration file you'll need to customize to run
the example server.

server.php - The PHP rendering script that takes care of handling
server requests from both regular user agents and consumers.

lib/actions.php - Handles the various types of requests that the
server supports.

lib/common.php - Supplies functions that wrap the OpenID API calls
to make them easier to use.

lib/render.php - Miscellaneous page rendering code.

lib/session.php - More miscellaneous page rendering code.

lib/render/*.php - Files for each page presented by the server.

0 comments on commit 7c89c27

Please sign in to comment.