Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'openid.php';
- try {
- $openid = new LightOpenID;
- $openid->required = array('contact/email');//
- $openid->optional = array('namePerson','namePerson/friendly','birthDate','person/gender');//
- if(!$openid->mode) {
- $openid->identity = 'yahoo.com';
- header('Location: ' . $openid->authUrl());
- ?>
- <form action="" method="post">
- <button>Login with Yahoo!</button>
- </form>
- <?php
- } elseif($openid->mode == 'cancel') {
- echo 'User has canceled authentication!';
- } else {
- echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
- print_r( $openid->getAttributes());//
- }
- } catch(ErrorException $e) {
- echo $e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement