Skip to content

setup two step verification with codeigniter And google authenticator

Notifications You must be signed in to change notification settings

mohGood/google-authenticator-codeigniter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

google-authenticator-codeigniter

setup two step verification with codeigniter And google authenticator

Usage: // load library

$this->load->library('GoogleAuthenticator');

	// generates the secret code
	$secret_code = $this->googleauthenticator->createSecret();

	// generates the QR code for the link the user's phone with the service
	$qr_code_url = $this->googleauthenticator->getQRCodeGoogleUrl('Mohsen', 'info@mohseng.ir', $secret_code);

	// also, you can get a code to test the service
	$one_code_with_app = $this->googleauthenticator->getCode($secret_code);

	// get the user's phone code and the secret code that was generated, and verify
	$checkResult = $this->googleauthenticator->verifyCode($secret_code, $one_code_with_app, 2); // 2 = 2*30sec clock tolerance

	if ($checkResult) {
		echo 'OK';
	} else {
		echo 'FAILED';
	}

About

setup two step verification with codeigniter And google authenticator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages