PHPackages                             holabs/totp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. holabs/totp

ActiveLibrary

holabs/totp
===========

Time-based One-time Password implementation for Nette framework

v0.1.0(7y ago)01.4k↓100%BSD-3-ClausePHPPHP &gt;=5.6

Since Jun 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Holabs/TOTP)[ Packagist](https://packagist.org/packages/holabs/totp)[ RSS](/packages/holabs-totp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Holabs/TOTP
===========

[](#holabstotp)

Implementation of [RobThree/TwoFactorAuth](https://github.com/RobThree/TwoFactorAuth) for Nette Framework.

Installation
------------

[](#installation)

**Requirements:**

- php 5.6+
- [nette/application](https://github.com/nette/application)
- [nette/di](https://github.com/nette/di)
- [robthree/twofactorauth](https://github.com/robthree/twofactorauth)

```
composer require holabs/totp
```

Configuration
-------------

[](#configuration)

```
extensions:
	holabs.totp: Holabs\TOTP\Bridges\Nette\TOTPExtension

holabs.totp:
	issuer: "AsIs"          # Will be displayed in the app as issuer name
	digits: 6               # The number of digits the resulting codes will be
	period: 30              # The number of seconds a code will be valid
	bits: 160               # The number of bits for encryption [recommended 80 or 160]
	discrepancy: 1			# The number of periods used to equal code from app
	algorythm: "sha1"		# The algorithm used [sha1, sha256, sha512, md5]
	qr:
		label: 'holabs'		# Required label for app
		provider: NULL		# QR-code provider [@see \RobThree\Auth\Providers\Qr\IQRCodeProvider]
	rng:
		provider: NULL		# Pseodo-random string provider [@see \RobThree\Auth\Providers\Rng\IRNGProvider]
	time:
		provider: NULL		# Time provider [@see \RobThree\Auth\Providers\Time\ITimeProvider]
```

You can choose your providers or use predefined.

Using
-----

[](#using)

Your **SignPresenter** now can looks like this:

```
