This is a very simple script to use the authentication
Follow the command below and track the commits to check the manual code changes
rails new basic-auth
rails g model Admin name login password_digest
rake db:migrate
rails c
Admin.create(name: 'Bruno Almeida', login: 'wwwbruno', password: '123456', password_confirmation: '123456')
Admin.authenticate('wwwbruno','12345')
Admin.authenticate('wwwbruno','123456')
ctrl + d