Vibe.d tutorial
  • Build web apps with Vibe.d
  • Setting up
  • The default hello world app
  • Use your own HTML page
  • Serving other static files
  • Diet templates
  • More template pages
  • Use your own functions
  • Templates for ease of maintenance
  • Using include in templates
  • Responsive layout using CSS Grid
  • A fixed navbar and sticky footer
  • CSS modal dialogues
  • The web interface
  • Setting up MySQL server and tools
  • The schema
  • Setting up MySQL for Vibe.d
  • The EmployeeController class
  • The EmployeeModel class
  • A form for adding a new employee
  • Saving form data into the database
  • Testing the whole thing
  • Listing all the employees
  • Retrieving a record for editing
  • Saving form changes to the database
  • Deleting a record from the database
  • Finding an employee record by name
  • Displaying error messages with _error
  • Authentication and authorization
  • Logging in and authentication
  • Saving the login state to the session
  • Enforcing authorization through the session
  • Logging out
  • All the sources so far
  • A new project
    • The timekeeping system
Powered by GitBook
On this page

Authentication and authorization

PreviousDisplaying error messages with _errorNextLogging in and authentication

Last updated 5 months ago

We need to restrict access to sensitive parts of our site so only authorized users (admins) can make changes to sensitive data. We need a login system to authenticate and to authorize users.

Authentication means verifying that the user is who he/she says he/she is. Authorization means determining which parts of the application the user is allowed access.

In a commercial company, only a limited number of people are supposed to access sensitive data such as employee records.

To achieve this, we need a login system to authenticate and authorize users.

Click on the Login link on the menu to show the login form and fill out with an existing data.

Of course, when you click the Login button, you get an error:

Let us fix that. Let us do the authentication part of the login system.