php

A collection of PHP scripts for OpenSSO

Before I get too far away from this code, I wanted to present my examples related to PHP and OpenSSO in a more logical order than the way in which I originally posted them. To that end, here is my collection of PHP/OpenSSO tutorials, showing how a PHP application can manually interact with an OpenSSO server in a single sign-on, identity-management world:

The PHP "headers already sent" error message

Still in my early days working with PHP, I've learned that it's really easy to generate the dreaded "headers already sent" error message. If for some reason you actually want to generate this error message intentionally, I've learned that all you have to do is try to send HTML body content (any non-header content) before calling the header() or setcookie() methods, and you'll get that PHP error message right away.

PHP redirect - How to send a redirect with PHP

PHP redirection FAQ: How can I redirect a user in a PHP script?

I've been working with OpenSSO a lot lately (Sun's open source identity management product), and one thing you see right away is that they redirect the user's browser a lot during the login process. During a typical login process a user will attempt to access a protected page; an OpenSSO agent will redirect the user's browser to the OpenSSO login page; and after a successful login they redirect you back to the protected resource.

OpenSSO and PHP - A simple PHP script to retrieve OpenSSO identity information

Here's a simple PHP program I wrote to test how PHP works with OpenSSO, specifically how it works with OpenSSO identity information.

I saved this file with the name info.php, then put it in a directory on my Apache web server that is protected by an OpenSSO login policy. To access this page, I enter the URL for the page in my browser and try to access it, with the URL being something like this:

Syndicate content