Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Concerning Single Sign-on, Bitcard (TypeKey), and OpenID

by jettero (Monsignor)
on Feb 25, 2007 at 15:21 UTC ( [id://602005]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $bc = Authen::Bitcard->new;
       $bc->token($assigned_bitcard_token);
       $bc->info_optional([qw(name username email)]);
       $bc->expires( 86400*30 );
       $bc->key_cache($bitcard_pubkey_cache);
    
  2. or download this
       print $cgi->p("Hi there...");
       print $cgi->p("Please ", $cgi->a({ href=>$bc->login_url({r=>$cgi->u
    +rl}) }, "login") . ".");
    
  3. or download this
    $ses->expire("+1y");  # most of the session lasts forever
    
    ...
        $ses->expire( user => "+1h" ); # this means every hour we'll verif
    +y(bc_data)
    }
    
  4. or download this
    use Net::OpenID::Consumer;
    use Digest::SHA1 qw(sha1);
    ...
    use DBM::Deep;
    use URI; # for port parsing
    use Time::HiRes qw(time);
    
  5. or download this
    my $nonce_pattern = q(%s%d%d%s my secret code words here) . $0;
    my $nonce = $ses->param("nonce") 
           || sha1(sprintf($nonce_pattern, time, (stat $0)[9], -s _, $clai
    +m));
    
  6. or download this
    my $ua = LWPx::ParanoidAgent->new;
    
    ...
    
        return 1;
    });
    
  7. or download this
    my $csr = Net::OpenID::Consumer->new( 
        consumer_secret => $nonce,
    ...
        ua              => $ua,
        required_root   => $this_domain,
        cache           => Cache::File->new(cache_root=>"$session_director
    +y/csr.cache/"));
    
  8. or download this
    if ( $claim and not $cgi->param("checked") ) {
        if( my $ci = $csr->claimed_identity($claim) ) {
    ...
        }
    
    }
    
  9. or download this
    elsif( my $setup_url = $csr->user_setup_url ) {
        # We only get here if we're not already logged into myopenid...
    ...
        exit 0;
    
    }
    
  10. or download this
    elsif( (my $vfid = $csr->verified_identity) or (my $user = $ses->param
    +("user")) ) {
        my $dbm = DBM::Deep->new(file=>$dbm_file, locking => 1, autoflush 
    +=> 1);
    ...
        exit 0;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://602005]
Approved by Joost
Front-paged by liverpole
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found