From the course: Building RESTful APIs with Flask

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

JSON Web Tokens

JSON Web Tokens

From the course: Building RESTful APIs with Flask

Start my 1-month free trial

JSON Web Tokens

- [Instructor] Most APIs involve user registration and logins, so you can track your app's users and grant them privileges. In the Planetary API, I want to allow registration for the planet discovering scientific community. In order to register a new planet or edit or delete an existing planet, you must be logged in. Listing the planets, planet details, and the registration endpoint itself will not require a login. There are several prebuilt login and user management plugins if you don't want to build one yourself. There's Flask-Login, which handles logging in, logging out, and session management. There's also Flask-User, which handles user registration, login, logout, and role based security, like the kind I mentioned earlier. When evaluating these plugins, remember traditionally Flask is used to make traditional template based websites. I don't like the idea of storing session data in my API projects, so I don't use anything that requires session management. Also, if you want to use…

Contents