backend implementation demonstration in go with JWT, MongoDB and etc.

Fandogh 🌰

GitHub Workflow Status Codecov PkgGoDev

APIs

register

curl 127.0.0.1:1378/register -X POST -d '{ "email": "[email protected]", "name": "Parham Alvani", "password": "123456" }' -H 'Content-Type: application/json'
{
  "Email": "[email protected]",
  "Password": "123456",
  "Name": "Parham Alvani"
}

login:

curl 127.0.0.1:1378/login -X POST -d '{ "email": "[email protected]", "password": "123456" }' -H 'Content-Type: application/json'
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1c2VyIiwiZXhwIjoxNjI1MzU4MDQ1LCJqdGkiOiI4NTYxYzA4NC1kYzAxLTQ0ZmEtODEyZS05ZjNhZDJlNDcxNTAiLCJpYXQiOjE2MjUzNTQ0NDUsImlzcyI6ImZhbmRvZ2giLCJuYmYiOjE2MjUzNTQ0NDUsInN1YiI6InBhcmhhbS5hbHZhbmlAZ21haWwuY29tIn0.hUiEGqQxCSTQOFDPBypKkdI85q7TxSGENY6IwA2QR7E",
  "Email": "[email protected]",
  "Password": "123456",
  "Name": "Parham Alvani"
}

new home:

curl -vvv 127.0.0.1:1378/api/homes -X POST  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1c2VyIiwiZXhwIjoxNjI1Mzc5MDE3LCJqdGkiOiI4NDRhMzQ4Yy03OGVjLTRlNTctODJhZi03YjU3NTNmNjk5ZjciLCJpYXQiOjE2MjUzNzU0MTcsImlzcyI6ImZhbmRvZ2giLCJuYmYiOjE2MjUzNzU0MTcsInN1YiI6InBhcmhhbS5hbHZhbmlAZ21haWwuY29tIn0.EZUWQ-sLP1ClA0vtK6vZEcQ4qf3ZaBm9VpFV6smEwUc' -F 'title=sweet' -F 'location=italy' -F 'description=a place to live' -F 'peoples=3' -F 'room=good' -F 'bed=single' -F 'rooms=4' -F'bathrooms=1' -F'contract=good' -F'price=100' -F'security_deposit=1000' -F'photos=1,2' -F'[email protected]' -F'[email protected]'
{
  "ID": "60e1535541e125c415973cd2",
  "Owner": "[email protected]",
  "Title": "sweet",
  "Location": "italy",
  "Description": "a place to live",
  "Peoples": 3,
  "Room": "good",
  "Bed": 1,
  "Rooms": 4,
  "Bathrooms": 1,
  "Smoking": false,
  "Guest": false,
  "Pet": false,
  "BillsIncluded": false,
  "Contract": "good",
  "SecurityDeposit": 1000,
  "Photos": {
    "1": "60e1535541e125c415973cd2_1",
    "2": "60e1535541e125c415973cd2_2"
  },
  "Price": 100
}
Owner
Parham Alvani
Backend Developer, Ph.D. Student, Happy and Smiling
Parham Alvani
Similar Resources

Golang implementation of JWT and Refresh Token

Fiber and JWT with Refresh Token Repo ini adalah demostrasi JWT support refresh token tanpa menggunakan storage Branch Main: unlimited refresh token R

Dec 18, 2022

An implementation of JOSE standards (JWE, JWS, JWT) in Go

Go JOSE Package jose aims to provide an implementation of the Javascript Object Signing and Encryption set of standards. This includes support for JSO

Dec 18, 2022

This is an implementation of JWT in golang!

jwt This is a minimal implementation of JWT designed with simplicity in mind. What is JWT? Jwt is a signed JSON object used for claims based authentic

Oct 25, 2022

Golang implementation of JSON Web Tokens (JWT)

jwt-go A go (or 'golang' for search engine friendliness) implementation of JSON Web Tokens NEW VERSION COMING: There have been a lot of improvements s

Jan 6, 2023

simple-jwt-provider - Simple and lightweight provider which exhibits JWTs, supports login, password-reset (via mail) and user management.

Simple and lightweight JWT-Provider written in go (golang). It exhibits JWT for the in postgres persisted user, which can be managed via api. Also, a password-reset flow via mail verification is available. User specific custom-claims also available for jwt-generation and mail rendering.

Dec 18, 2022

A Sample Integration of Google and GitHub OAuth2 in Golang (GoFiber) utilising MongoDB

Go Oauth Server This is sample OAuth integration written in GoLang that also uses MongoDB. This is a sample TODO Application where people can Create a

Dec 27, 2022

A demo of authentication and authorization using jwt

A demo of authentication and authorization using jwt

Nogopy Hi, this a demo of how to use jwt for authentication in microservices Keep in mind that this is a demo of how to authenticate using jwt, we don

Nov 1, 2021

JWT and Permission Middleware with MongoRPC

JWT and Permission Middleware with MongoRPC

Nov 19, 2021

Generate and verify JWT tokens with Trusted Platform Module (TPM)

golang-jwt for Trusted Platform Module (TPM) This is just an extension for go-jwt i wrote over thanksgiving that allows creating and verifying JWT tok

Oct 7, 2022
Golang with JWT, Go Gin and MongoDB

User authentication in Golang with JWT, Go Gin and MongoDB Golang backend application that uses JWT tokens for users Locally Up Setup your .env file,

Sep 16, 2022
Go-auth - An authorization project using mongoDB, JWT and Go
Go-auth - An authorization project using mongoDB, JWT and Go

Ssibrahimbas Go-Auth An authorization project using mongoDB, JWT and Go. API Typ

Mar 10, 2022
Go-gin-jwt - Secure web api using jwt token and caching mechanism

Project Description This project demonstrate how to create api and secure it wit

Jan 27, 2022
Golang Mongodb Jwt Auth Example Using Echo
Golang Mongodb Jwt Auth Example Using Echo

Golang Mongodb Jwt Auth Example Using Echo Golang Mongodb Rest Api Example Using Echo Prerequisites Golang 1.16.x Docker 19.03+ Docker Compose 1.25+ I

Nov 30, 2022
JWT wrapper library which makes it simple to use ECDSA based JWT signing

JWT JWT wrapper library which makes it simple to user ECDSA based JWT signing. Usage package main import ( "context" "github.com/infiniteloopcloud

Feb 10, 2022
Account-jwt-go - Simple JWT api with go, gorm, gin
Account-jwt-go - Simple JWT api with go, gorm, gin

Account JWT on Go Go, gorm, Gin web framework 를 활용하여 만든 간단한 JWT API 입니다. Dajngo의

Apr 14, 2022
Krakend-jwt-header-rewriter - Kraken Plugin - JWT Header Rewriter

Kraken Plugin - JWT Header Rewriter 1 Plugin Configuration Name Desciption Defau

Feb 15, 2022
Backend Development Rest Api Project for book management system. Used Features like redis, jwt token,validation and authorization.

Golang-restapi-project Simple Rest Api Project with Authentication, Autherization,Validation and Connection with redis File Structure ├── cache │ ├──

May 25, 2022
Demonstration of sharing secret data between an OAuth/OIDC client and an Identity Providers web client.

OAuth / OIDC Cubbyhole Share secret data between client applications. This is mostly a demonstration of some of the work I've been evaluating at Storj

Mar 21, 2022
A fast and simple JWT implementation for Go
A fast and simple JWT implementation for Go

JWT Fast and simple JWT implementation written in Go. This package was designed with security, performance and simplicity in mind, it protects your to

Jan 5, 2023