PHP Class Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticator

Show file Open project: scheb/two-factor-bundle Class Usage Examples

Public Methods

Method Description
__construct ( Google\Authenticator\GoogleAuthenticator $authenticator, string $server, string $issuer ) Construct the helper service for Google Authenticator.
checkCode ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user, string $code ) : boolean Validates the code, which was entered by the user.
generateSecret ( ) : string Generate a new secret for Google Authenticator.
getQRContent ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user ) : string Generate the content for a QR-Code to be scanned by Google Authenticator Use this method if you don't want to use google charts to display the qr-code
getUrl ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user ) : string Generate the URL of a QR code, which can be scanned by Google Authenticator app.

Method Details

__construct() public method

Construct the helper service for Google Authenticator.
public __construct ( Google\Authenticator\GoogleAuthenticator $authenticator, string $server, string $issuer )
$authenticator Google\Authenticator\GoogleAuthenticator
$server string
$issuer string

checkCode() public method

Validates the code, which was entered by the user.
public checkCode ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user, string $code ) : boolean
$user Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface
$code string
return boolean

generateSecret() public method

Generate a new secret for Google Authenticator.
public generateSecret ( ) : string
return string

getQRContent() public method

Generate the content for a QR-Code to be scanned by Google Authenticator Use this method if you don't want to use google charts to display the qr-code
public getQRContent ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user ) : string
$user Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface
return string

getUrl() public method

Generate the URL of a QR code, which can be scanned by Google Authenticator app.
public getUrl ( Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface $user ) : string
$user Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface
return string