Golang: Intro to REST API JWT auth with Go programming lang

0
Certificate

Paid

Language

Level

Beginner

Last updated on April 18, 2025 2:46 pm

Learn how to build secure Golang APIs with JSON Web Tokens (JWTs). Create user registration, login, and protected endpoints. Authenticate users with email, password, and JWTs. Gain insights into Golang package methods and Postgres database integration. Perfect for anyone interested in JWT authenticated RESTful APIs with Golang.

Add your review

What you’ll learn

  • Build a user registration and login backend with Golang
  • Understand JSON Web Tokens (Header, Payload, Signature)
  • Create RESTful APIs (user signup, login and a protected endpoint)
  • Authenticate users with email, password and a JWT
  • Secure RESTful endpoints with JWTs
  • Examine the internals of a JWT
  • Sign and validate a JWT
  • Create a Postgres database instance and a users table and insert records into the table
  • Examine the definitions of different Golang package methods

Build Golang (Go programming language) REST API authentication with JWTs is a simple introductory guide to creating secure Golang APIs with JSON Web Tokens (JWTs).

You will:

learn the theory behind JSON WEB TOKENs (JWTs) and how they are constructed and used,

build a Golang (Go programming language) signup handler function that takes the user’s credentials such as email and password and saves them on a PostgreSQL database table,

implement a Golang (Go programming language) utility that generates password hashes with the ‘bcrypt’ package to avoid storing plain text passwords on the database

build a Golang (Go programming language) login handler function that takes user credentials and verifies the user based on their supplied credentials

implement a Token generator utility that takes the user’s credentials, and together with developer specified secret and claims, generates a JSON Web Token (JWT),

create a Golang (Go programming language) middleware function that validates a JWT token upon request to restricted routes

Also, Throughout the process you will learn several Golang (Go programming language) and REST API authentication concepts.

Aside from Golang (Go programming language), some of the major technologies you will use are:

  • PostgreSQL database to create a database instance and a users table where your records will be stored in,

  • jwt-gopackage for generating the JSON Web Token and its validation,

  • gorilla/muxpackage for creating the router that your endpoints and handler functions will be registered on,

  • pqpackage for parsing your database instance’s URL,

  • database/sqlpackage for establishing and maintaining connection with your database instance,

  • bcrypt’ package for generating and comparing your password hashes,

  • Postman application for testing your APIs with several HTTP requests

Who this course is for:

  • Anyone interested in creating JWT authenticated RESTful APIs with Golang

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “Golang: Intro to REST API JWT auth with Go programming lang”

×

    Your Email (required)

    Report this page
    Golang: Intro to REST API JWT auth with Go programming lang
    Golang: Intro to REST API JWT auth with Go programming lang
    LiveTalent.org
    Logo
    LiveTalent.org
    Privacy Overview

    This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.