Giter VIP home page Giter VIP logo

zaheb's Introduction

OTPass Bundle

The Laravel OTPass bundle can work with Google's Authenticator app and/or support most (if not all) OATH based HOTP/TOTP systems.

Installing using Artisan CLI:

php artisan bundle:install OTPass

Either auto-load the bundle in application/bundles.php:

return array(
    'otpass' => array('auto' => true)
);

Or manually start:

Bundle::start('otpass');

Usage/Examples

To Generate a User Random Key

HOTPass::userRandomKey();

// will generate a random key like 35ZCFIQ4SXTO6EYL

Getting the HOTP number

This will generate the HOTP number that will change every 30 sec, and you can compare it with the same code generated by Google's Authenticator app.

You have to provied the User Random Key that should be stored with User Info.

HOTPass::generate("35ZCFIQ4SXTO6EYL", 30);
// for example HOTP number 173787

Generate QRcode

To Generate QRcode to be scanned with Google's Authenticator app. To setup the account in the app.

@param String $user is the user name @param String $host is the website base url @param String $secret is the secret that was genereted for the user

HOTPass::getQRcodeURL("zeroows", "localhost", $secret);
// it will return link like http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl=otpauth://totp/localhost:zeroows?secret=35ZCFIQ4SXTO6EYL&chld=H|0

License

Apache License 2

Copyright 2012 Abdulrhman Alkhodiry

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

zaheb's People

Contributors

zeroows avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.