Go-auth - An authorization project using mongoDB, JWT and Go

Overview


Ssibrahimbas Go-Auth

An authorization project using mongoDB, JWT and Go.

API

Types
User
HTTP REQUEST Name
POST Register
POST Login
GET Verify Login



UserType

the user's fields and their types.

Field Json Bson GoLang Type
name name name Name string
gender gender gender Gender string
age age age Age int
email email email Email string
password password password Password string

In Golang, starting fields with a capital letter makes them public. That's why the first letters of all our fields are capitalized. If we didn't want them to be accessible from outside (private), we would write them in lowercase.



register

If the user registers and the transaction is successful, a token is returned is the header of the Response.

Params Type
name string
gender string
age int
email string
password string

Example Request

POST http://localhost:8080/api/register
Content-Type: application/json

{
    "name": "Sami Salih İbrahimbaş",
    "gender": "Man",
    "age": 20,
    "email": "[email protected]",
    "password": "secretPassword"
}

Returns

{
    "success": true,
    "message": "Login Successful."
}



login

The user enters the email and password fields. If there is a registration and the passwords match, the login is provided. In the header of Response, the token is passed as in the registration process.

Params Type
email string
password string

Example Request

POST http://localhost:8080/api/login
Content-Type: application/json

{
    "email": "[email protected]",
    "password": "secretPassword"
}

Returns

{
    "success": true,
    "message": "Login Successful."
}



verifyLogin

Token is sent in Request's Header. If the token exists and is available, the entry is validated. Otherwise, an error is received.

Example Request

GET http://localhost:8080/api/verifyLogin
Authorization: Bearer dssdcvkşldscasşasdşlsadlşef

Returns

{
  "success": false,
  "message": "Not Authorized"
}



Owner
Sami Salih İbrahimbaş
Full Stack Developer
Sami Salih İbrahimbaş
Blog-mongodb - this repository for educational purpose, learn how to use mongodb and use mongodb with go

ENDPOINT ENDPOINT METHOD ACCESS /register POST all /login POST all /articles GET all /articles POST all /articles/{articleId} GET all /articles/{artic

Muhammad Al Farizzi 0 Jan 4, 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 │ ├──

Srijan Chakraborty 1 May 25, 2022
Authorization and authentication. Learning go by writing a simple authentication and authorization service.

Authorization and authentication. Learning go by writing a simple authentication and authorization service.

Dinesh Bhattarai 0 Jan 30, 2022
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

null 2 Nov 1, 2021
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

Jeremy Panjaitan 0 Jan 27, 2022
vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault. Create user accounts, add TOTP tokens (user supplied pin + totp), and have peace of mind using 2FA.

Mike McRill 6 Jul 5, 2021
vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault.

vault-plugin-auth-usertotp is an auth method plugin for HashiCorp Vault. Create user accounts, add TOTP tokens (user supplied pin + totp), and have peace of mind using 2FA.

null 0 Jul 30, 2021
Gets Firebase auth tokens (for development purposes only)Gets Firebase auth tokens

Firebase Token Gets Firebase auth tokens (for development purposes only) Getting started Create Firebase project Setup Firebase authentication Setup G

MousyBusiness 1 Nov 17, 2021
JWT Auth in Golang

Credits This package used github.com/dgrijalva/jwt-go underhood and it heavily based on this post: http://www.inanzzz.com/index.php/post/kdl9/creating

Pablo Fuentes 0 Dec 12, 2021
backend implementation demonstration in go with JWT, MongoDB and etc.

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

Parham Alvani 12 May 18, 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,

Al Mamun Khan 10 May 27, 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

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

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

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

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

null 0 Feb 15, 2022
telegram authorization in telegram without using a widget

TGAH - telegram Authorization Example of authorization in telegram without using a widget Installation go get -d github.com/tioffs/[email protected] Setti

tioffs 2 Jun 6, 2022
A simple user identify template with jwt token and gin, toy project

Simple Docs Register url : /api/auth/register param type value name string username password string password mailbox string mailbox response: { "sta

null 1 Dec 31, 2021
Mini-framework for multiple authentication and authorization schemes

Go authorization pattern This repository demonstrates an authorization pattern that allows multiple schemes. Demo To start the demo run the following

Tim van Osch 0 Dec 30, 2021
Authelia: an open-source authentication and authorization server providing two-factor authentication

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

Streato 0 Jan 5, 2022
🔑 Authz0 is an automated authorization test tool. Unauthorized access can be identified based on URL and Role.

Authz0 is an automated authorization test tool. Unauthorized access can be identified based on URL and Role. URLs and Roles are managed as YAML-based

HAHWUL 286 Jun 27, 2022