Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Logging in with Google accounts requires setting special identity, so this example shows how to do it.
- require 'openid.php';
- try {
- # Change 'localhost' to your domain name.
- $openid = new LightOpenID('http://seamkard.com');
- if(!$openid->mode) {
- if(isset($_GET['login'])) {
- $openid->identity = 'http://steamcommunity.com/openid';
- header('Location: ' . $openid->authUrl());
- }
- ?>
- <form action="?login" method="post">
- <button>Login with Steam</button>
- </form>
- <?php
- } elseif($openid->mode == 'cancel') {
- echo 'User has canceled authentication!';
- } else {
- echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
- }
- } catch(ErrorException $e) {
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement