Author image Peter Vereshagin


  Net::OpenID::Server::Standalone - personal standalone OpenID server ready-to-use out-of-the-box


id script use this:


setup script use this:


Some kind of Net::OpenID::Server::Standalone::Config is a must. For more sophisticated use see "USAGE" below.


Nossa is dedicated for fast installation of your own OpenID 'Server' on a CGI/FCGI::Spawn - enabled hosting. There is a lot of tweaks for common needs known as: your own identity source to be pluggable with, your own design for user setup pages, location of your CGI::Session storage, your SRE information, redirect to your HTTPS server for setup, etc.

Typical layout follows:

  ./ --- application root, e. g. $HOME on your hosting.
    lib/Net/OpenID/Server/Standalone/ --- configuration of your OpenID server,
                    created from sample
    www/ or public_html/
      index.html or whatever to be your XRD document like it is at
    cgi/ or perl/ or cgi-bin/ or www/
      id.cgi    or    or id    --- id script
      setup.cgi or or setup --- setup script

Of course those mentioned last three can be on the different servers as different URLs. The workflow is as follows: id script checks user identity and setup shows forms. Target of those forms is an id script, too.

You may use your own and MyApp/ ( see below ).


Net::OpenID::Server, Data::UUID, MIME::Base64, HTML::Entities, Digest::MD5, CGI, CGI::Session.

Variables and Subs

  • $htmlStyle

    hash reference for HTML code for your setup pages: the 'start' key holds a value for start of the page, and the 'end' key holds a value for trhe end.

  • hashFunction()

    is a function that provides hash for your password storage. MD5 is the default.

  • new()

    Object constructor, starts session and so on.

  • id()

    performs identification, should be pointed as an 'openid.delegate' URL in your XRD document ( located on your OpenID URL ).

  • setup()

    shows forms for login, logout and for trust the requesting URL. For use in the 'setup' script.

  • redirect() and redirectMessage()

    overrideable for your inherited package needs. Use to take HTTP status and URL location as parameters. redirectMessage returns the message for user.

  • cgiHiddens()

    function that turns OpenID values for the default setup_map of the Net::OpenID::Server into the hidden inputs for the form on the setup URL.

  • printLoginForm()

    prints login form for setup script;

  • printLoginForm()

    prints 'trust this root' form for setup script;

  • printLoginForm()

    prints logout form for setup script;


For 'do it quick' see the examples: index.html, id and setup. Also, Net::OpenID::Server::Standalone::Config is an example about how you could set up your own ::Config. You should do it in any case.

For more custom-made setup you can inherit Nossa like this:

  $ cat lib/MyApp/
  package MyApp::Nossa;
  use strict;
  use warnings;
  # inheritance stuff
  use base qw/Net::OpenID::Server::Standalone/;
  # your own hash function initialization
  use Digest::SHA256;
  my $dig = Digest::SHA256::new( 512 );
  # your own stylings around forms; override the print*Form methods for even more and/or inner styling
  our $htmlStyle = { start  => "<html><body height='100%'><table width='100%' height='100%'"
                              ."><tr><td height='100%' align='center' valign='middle'"
                     end    => "</td></tr>"
  # the hash function
  sub hashFunction{
    my $pass = shift;
    $dig->hexhash( $pass );


  $ cat lib/MyApp/Nossa/
  package MyApp::Nossa::Config;

  use strict;
  use warnings;
  use base qw/Net::OpenID::Server::Standalone::Config/;
  our $config = {
    # set up your values here as described in L<Net::OpenID::Server::Standalone::Config>


for different storage methods, you may want to set up your own get() in your Config package. You shouldn't need to 'use base N:O:S:Sa::Config' in such a case.

  $ cat id
  use warnings;
  use strict;
  our $nossaLibDir;
    use File::Basename qw/dirname/;
    use Cwd qw/realpath/;
    $nossaLibDir = realpath( dirname( __FILE__ ).'/../lib' );
    push( @INC, $nossaLibDir  )
      unless grep { $_ eq $nossaLibDir } @INC;
  use MyApp::Nossa;

Same goes here for setup script except


is the last line.

Downloads and more info - browseable repository with snapshots - home page with actual links, etc. - GitHub page for bugs and reporting of them

VCS downloads

Git users use this:

  git clone git://

Subversion users use one of these:

  svn checkout nossa-read-only
  svn checkout


Peter Vereshagin <> ( ). Based on stuff from:

  # Author: Alex Efros <>, 2008
  # License: Public Domain

License: consider BSD is the closest to be of that domain.