0

I'm looking for a login system like stackoverflow for my project, and for that I googled many scripts but not working like stackoverflow login system work. Stackoverflow using JQUERY Simple OPENID for login authentication. But jquery openid which i downloaded from its original source is incomplete package. The form action predefined in jquery simple openid package is missing or not available. I know this action will be given by user itself but i want the script that will handle authentication at backend just like stackoverflow. I need a backend handler script which store accesstoken and and refresh token in database and reuse these accessTokens. Script supporting language might be java or php

enter image description here

Waqas Ghouri
  • 1,079
  • 2
  • 16
  • 36

2 Answers2

0

Following link could be helpful in order to integrate the OpenId

How to integrate OpenId Login System

For Example code please refer to the below link

Example Code

Example Code

<?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('localhost');
    if(!$openid->mode) {
        if(isset($_GET['login'])) {
            $openid->identity = 'https://www.google.com/accounts/o8/id';
            header('Location: ' . $openid->authUrl());
        }
?>
<form action="?login" method="post">
    <button>Login with Google</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();
}
Community
  • 1
  • 1
Vaibs_Cool
  • 6,126
  • 5
  • 28
  • 61
  • The example code i already used and it working but it not working like stackoverflow. After i logging in how to use that code which i got from google after authentication, i want to store that code with user-id and use same code for re-login. and i dont know how to use that code. http://www.google.com/accounts/8/id?id=xxxxxxxxxxxxxxxxxxxxxxxxxxx – Waqas Ghouri Sep 07 '13 at 07:14
0

It is possible to use Server Side code for OpenID authentication. Links:

if you want use PHP:

http://gitorious.org/lightopenid - An PHP 5 library for easy openid authentication

or

https://github.com/openid/php-openid - OpenID library for PHP5

Daniel L.
  • 5,060
  • 10
  • 36
  • 59
aksu
  • 5,221
  • 5
  • 24
  • 39