Skip to content

vikbert/symfony5-login-auth-demo

Repository files navigation

symfony logo

Symfony 5 Authentication Demo

Login demo with the new authentication system in symfony 5

PRs Welcome MIT License


Install

composer install 

Development

symfony serve 

Development from scratch

symfony new symfony5-auth-demo-login
cd symfony5-auth-demo-login

symfony composer req maker
symfony composer req security
symfony composer req orm

# enable sqlite config in .env
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"//
symfony console make:user

symfony composer req annotations 
symfony composer req twig
symfony console make:auth
symfony console debug:router

# load test user into database
symfony composer req orm-fixtures
symfony console make:migration
symfony console doctrine:mi:mi -n
symfony console make:fixtures 
symfony console doctrine:fixtures:load

symfony composer require --dev symfony/profiler-pack

symfony console make:controller # ProfileController
# protect the profile in controller
$this->denyAccessUnlessGranted('ROLE_USER');
# update the redirect URL in LoginFormAuthenticator
new RedirectResponse($this->urlGenerator->generate('app_profile'));

# complete the implementation in LoginFormAuthenticator

more detailed info in cli-protocol.md

licence

MIT @vikbert

About

Login authentication demo with the new authentication system in symfony 5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published