A minimal package that helps you login with any password on local environments

Overview

Laravel Anypass

anypass_header

Latest Stable Version Quality Score Build Status License StyleCI

Built with ❤️ for every "lazy" laravel developer ;)

It is always painful to remember and type in the correct password in the login form while you are in development...

It would be nice to be able to login with any password in local environment and only by changing the .env variables(not the application code), switch to: "real password checking".

(This means you do not need to change your application code, when you deploy your app to production while you enjoy the ease in local environments.)

Actually the behaviour of the auth()->attempt($credentials); simply changes based on the config variable in the auth.php and .env file!

Performance hit:

This package is only a few lines (about 20 lines) of code with almost no overhead.

It is also completely safe to avoid installing it on production without changing your code. Since it is a dev only dependency in your composer.json file.

  "require-dev": {
       "imanghafoori/laravel-anypass": "dev-master",
        ...
  },

Config

To avoid accidental security vulnerabilities, 3 conditions should match before you can login with any password :

in your .env file you must:

1 - APP_ENV=local  // or APP_ENV=testing
2 - APP_DEBUG=true
3 - ANY_PASS=true

That way it is very unlikely to accidentally misconfigure your app to accept any wrong password on production server.

We highly recommend to take a look to the source code.

By default, Anypass will only work if the APP_ENV is set to local or testing. You can override this by defining ANY_PASS_ENVIRONMENTS in your .env file, and setting the value to a comma-separated string of environments. For example:

ANY_PASS=true
ANY_PASS_ENVIRONMENTS="local,testing,acceptance"

💓 Note

You can not login with an invalid username or an invalid api token. Only the password checking is by-passed.

🔥 Installation

composer require --dev imanghafoori/laravel-anypass

(For laravel 5.4 and below: Instead of adding the service provider in the config/app.php file, you can add the following code to your app/Providers/AppServiceProvider.php file, within the register() method:

public function register()
{
    if ($this->app->environment() === 'local' || $this->app->environment() === 'testing') {
        $this->app->register(\Imanghafoori\AnyPass\AnyPassServiceProvider::class);
    }
    // ...
}

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Your Stars Make Us Do More

As always if you found this package useful and you want to encourage us to maintain and work on it, Please press the star button to declare your willing.

More from the author:

Laravel Terminator

💎 A minimal yet powerful package to give you opportunity to refactor your controllers.


Laravel Widgetize

💎 A minimal yet powerful package to give a better structure and caching opportunity for your laravel apps.


Laravel Master Pass

💎 A simple package that lets you easily impersonate your users.


Laravel HeyMan

💎 It allows to write exressive and defensive code whcih is decoupled from the rest of your app.


🍌 Reward me a banana 🍌

So that I will have energy to start the next package for you.

  • Dodge Coin: DJEZr6GJ4Vx37LGF3zSng711AFZzmJTouN
  • LiteCoin: ltc1q82gnjkend684c5hvprg95fnja0ktjdfrhcu4c4
  • BitCoin: bc1q53dys3jkv0h4vhl88yqhqzyujvk35x8wad7uf9
  • Ripple: rJwrb2v1TR6rAHRWwcYvNZxjDN2bYpYXhZ
  • Etherium: 0xa4898246820bbC8f677A97C2B73e6DBB9510151e

You might also like...
Laravel package to easily login as other users during development.
Laravel package to easily login as other users during development.

A Laravel 5.4 utility package to enable developers to log in as other users during development. Installation To install the package, simply follow the

PermissionsMakr is a Laravel package that will help any developer to easily manage the system's users permissions

PermissionsMakr is a Laravel package that will help any developer to easily manage the system's users permissions

A whitelabeled and modernized wp-login.php
A whitelabeled and modernized wp-login.php

Modern Login Here lives a simple mu-plugin to whitelabel and modernize wp-login.php. No admin panels, no bloat – just a simple filter to optionally cu

Braindead simple social login with Laravel and Eloquent.
Braindead simple social login with Laravel and Eloquent.

Important: This package is not actively maintained. For bug fixes and new features, please fork. Eloquent OAuth Use the Laravel 4 wrapper for easy int

Un proyecto que crea una API de usuarios para registro, login y luego acceder a su información mediante autenticación con JSON Web Token

JSON WEB TOKEN CON LARAVEL 8 Prueba de autenticación de usuarios con una API creada en Laravel 8 Simple, fast routing engine. License The Laravel fram

User registration and login form with validations and escapes for total security made with PHP.

Login and Sign Up with PHP User registration and login form with validations and escapes for total security made with PHP. Validations Required fields

Register ,Login , Logout , having access control
Register ,Login , Logout , having access control

Helo what's up dude read by the name of creator lov3yp :D This script is inspired by Lov3yp#2018 And Burak karahan Installation steps: !- Import the s

A complete Login and Register page using a Mysql Database and php
A complete Login and Register page using a Mysql Database and php

Login With Mysql A complete Login and Register page using a Mysql Database 🔨 Built with ⚙️ 📝 Description A login with Frontend, Backend and Database

Login Using Laravel UI

Projeto Laravel utilizando a biblioteca Laravel UI para autenticação de usuários com Username e Senha.

Comments
  • This doesn't work based on .ENV variables

    This doesn't work based on .ENV variables

    I have just installed and tested this package.

    I have the following in my .ENV:

    APP_ENV=local
    APP_DEBUG=true
    ANY_PASS=true
    

    I then changed the config/auth.php so that it uses anyPass as you showed in this issue:

    'providers' => [
            'users' => [
                'driver' => 'eloquentAnyPass',
                'model' => App\Models\User::class,
            ]
        ],
    
    

    So now I can log in with any password which is fine.

    However if I change ANY_PASS=false or APP_DEBUG=false and then clear my config cache it still allows me to log in with any password. There is no checking to see if we are on a local environment which is a very dangerous move.

    Testing on Laravel 5.6 on PHP 7.2.5

    opened by shabaz-ejaz 8
  • Allow defining Anypass environments with an env variable

    Allow defining Anypass environments with an env variable

    This PR adds the ability to define the environments that Anypass works in. This is useful when you want to use Anypass on environments other than local or testing (such as staging or acceptance).

    Since you can't define arrays in env values, the ANY_PASS_ENVIRONMENTS setting accepts a comma separated list of environments. If you don't explicitly define this env value, the default local and testing environments are used.

    opened by SjorsO 4
  • Laravel 9.x Compatibility

    Laravel 9.x Compatibility

    This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 9.x.

    Before merging, you need to:

    • Checkout the l9-compatibility branch
    • Review all comments for additional changes
    • Thoroughly test your package

    If you do find an issue, please report it by commenting on this PR to help improve future automation.

    opened by laravel-shift 2
Releases(v1.0.8)
Owner
Iman
Coding is sport, it is art, it is science.
Iman
Instantly login as user via a single button tap on dev environments.

Getting tired of always entering login details in local dev environments? This package adds a button to instantly login a user! Installation You can i

Quinten Buis 3 Feb 18, 2022
Laravel Users (Roles & Permissions, Devices, Password Hashing, Password History).

LARAVEL USERS Roles & Permissions Devices Password Hashing Password History Documentation You can find the detailed documentation here in Laravel User

Pharaonic 8 Dec 14, 2022
A Blade component to quickly login to your local environment

Quickly login to your local environment When developing an app that has an admin section (or any non-public section), you'll likely seed test users to

Spatie 233 Dec 22, 2022
It's authorization form, login button handler and login to your personal account, logout button

Authorization-form It's authorization form, login button handler and login to your personal account, logout button Each file is: header.php - html-fil

Galina 2 Nov 2, 2021
Minimal Laravel authentication scaffolding with Blade and Tailwind.

Introduction Breeze provides a minimal and simple starting point for building a Laravel application with authentication. Styled with Tailwind, Breeze

The Laravel Framework 2.1k Jan 3, 2023
This package helps you to associate users with permissions and permission groups with laravel framework

Laravel ACL This package allows you to manage user permissions and groups in a database, and is compatible with Laravel v5.8 or higher. Please check t

Mateus Junges 537 Dec 28, 2022
A One Time Password Authentication package, compatible with Google Authenticator.

Google2FA Google Two-Factor Authentication for PHP Google2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HM

Antonio Carlos Ribeiro 1.6k Dec 30, 2022
A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package

laravel-social A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package. I

Sergi Tur Badenas 42 Nov 29, 2022
This is a lightweight package that allows you assign roles and permissions to any Laravel model, or on a pivot table (many to many relationship).

Simple Laravel roles and permissions Introduction This package allows you to assign roles and permissions to any laravel model, or on a pivot table (m

null 52 Nov 10, 2022
Provides a unified interface to local and remote authentication systems.

Aura.Auth Provides authentication functionality and session tracking using various adapters; currently supported adapters are: Apache htpasswd files S

Aura for PHP 125 Sep 28, 2022