An imaginary authentication and session tracking service that is defined in this Apiary

Userland

This repository contains impelementation of "Userland" on boarding project

Userland is an imaginary authentication and session tracking service that is defined in this Apiary

This implementation is going to have extra requirements:

  • Password minimum 8 characters, has lowercase, uppercase, number
  • Forgot password: must be different from last 3 passwords
  • Use at some common JWT tokens payload
  • Use JTI to revoke session https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7
  • Use prepared statement
  • Change email, needs to send confirmation email to the new email
  • Delete account = soft delete
  • Client list can be added on demand with “upsert”
  • Password is hashed on rest, hash using bcrypt
  • OTP has timeout and immediately revoke OTP when it is used

How to run the code

Step 1: Clean download libraries

from the root folder, run go mod tidy

Step 2: Environment setup

run docker-compose up from the root repository

Postgres image is from https://hub.docker.com/_/postgres

By default, the internal database is served in db_userland:5432 , with connection string: postgres://admin:admin@db_userland:5432/userland Postgres data is stored in {root_repo}/data. Those defaults can be modified in:

postgres:
    image: postgres:14-alpine
    restart: on-failure
    volumes:
        - ./data:/var/lib/postgresql/data # default postgres data location
    environment:
        - POSTGRES_USER=admin # default username
        - POSTGRES_PASSWORD=admin # default password
        - POSTGRES_DB=userland # default db name
        - PGPORT=5432 # default port
    networks: 
      default:
        aliases: 
          - db_userland # default host
    expose:
      - 5432 # default port exposed in docker default network

To inspect the database with GUI, use the adminer (from https://hub.docker.com/_/adminer) via 0.0.0.0:8081. The default port can be configured in

adminer:
    ...
    ports:
      - "8081:8080/tcp" # default to 8081
		...

Step 3: Using the app

By default, the service is running on :8080 , that can be modified by changing the docker compose file

userland:
	...
	ports:
  	- "8080:80/tcp" # set 8080 to other port
  ...
Similar Resources

AuthService is a service that provides authentication with Minecraft Mojang.

AuthService AuthService is a service that provides authentication with Minecraft Mojang. Protobuf is managed by Buf. Command to pull Protobuf files wi

Aug 20, 2022

HTTP Session Management for Go

SCS: HTTP Session Management for Go Features Automatic loading and saving of session data via middleware. Choice of server-side session stores includi

Jan 1, 2023

Go session management for web servers (including support for Google App Engine - GAE).

Session The Go standard library includes a nice http server, but unfortunately it lacks a very basic and important feature: HTTP session management. T

Oct 10, 2022

Straightforward HTTP session management

sessionup 🚀 Simple, yet effective HTTP session management and identification package Features Effortless session management: Initialization. Request

Oct 10, 2022

Validate Django auth session in Golang

GoDjangoSession Valid for django 3.0.5 Usage: package main import ( "encoding/base64" "fmt" "session/auth" "github.com/Kuzyashin/GoDjangoSession"

Aug 23, 2022

Auth Middleware for session & white-listed routing

Auth Middleware for session & white-listed routing

Nov 4, 2021

Ginx - Evilginx2 - A man-in-the-middle attack framework used for phishing login credentials along with session cookies

Ginx - Evilginx2 - A man-in-the-middle attack framework used for phishing login credentials along with session cookies

evilginx2 is a man-in-the-middle attack framework used for phishing login creden

Mar 19, 2022

Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.

❗ Cache package has been moved to libcache repository Go-Guardian Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to

Dec 23, 2022

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

Goth: Multi-Provider Authentication for Go Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applic

Dec 29, 2022
Go (lang) HTTP session authentication

Go Session Authentication See git tags/releases for information about potentially breaking change. This package uses the Gorilla web toolkit's session

Dec 22, 2022
Authelia: an open-source authentication and authorization server providing two-factor authentication
Authelia: an open-source authentication and authorization server providing two-factor authentication

Authelia is an open-source authentication and authorization server providing two

Jan 5, 2022
Barbar Service is a project for demo of simple distribute authentication Service.
Barbar Service is a project for demo of simple distribute authentication Service.

Barbar Service Barbar Service is a project for demo of simple distribute authentication Service. Project Structure Basicaly we reffer to Domain Driven

Aug 29, 2022
Authentication Plugin for implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0, SAML Authentication
Authentication Plugin for implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0, SAML Authentication

Authentication Plugin for implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0, SAML Authentication

Jan 8, 2023
A simple passwordless authentication middleware that uses only email as the authentication provider
A simple passwordless authentication middleware that uses only email as the authentication provider

email auth A simple passwordless authentication middleware that uses only email as the authentication provider. Motivation I wanted to restrict access

Jul 27, 2022
Package gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends.

sessions gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends. The key features are: Simple API: us

Dec 28, 2022
🍪CookieMonster is a command-line tool and API for decoding and modifying vulnerable session cookies from several different frameworks.

?? CookieMonster CookieMonster is a command-line tool and API for decoding and modifying vulnerable session cookies from several different frameworks.

Jan 8, 2023
Server bridging Google's OAuth and service using Radius for authentication

Fringe Fringe is an easy workaround for Google Workplace users who need a Radius server to perform authentication on behalf of other services (e.g. 80

Mar 7, 2022
Advent of Code Input Loader, provide a session cookie and a problem date, returns a string or []byte of the input

Advent of Code Get (aocget) A small lib to download your puzzle input for a given day. Uses your session token to authenticate to obtain your personal

Dec 9, 2021
Authentication service that keeps you in control without forcing you to be an expert in web security.
Authentication service that keeps you in control without forcing you to be an expert in web security.

Authentication service that keeps you in control without forcing you to be an expert in web security.

Jan 1, 2023