• Stars
    star
    169
  • Rank 217,165 (Top 5 %)
  • Language
    Go
  • Created over 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example application that implements JWT based authentication

JWT Go example

Example application that implements JWT based authentication. Read the blog post here

To run this application, build and run the Go binary:

go build
./jwt-go-example

Now, using any HTTP client with support for cookies (like Postman, or your web browser) make a sign-in request with the appropriate credentials:

POST http://localhost:8000/signin

{"username":"user1","password":"password1"}

You can now try hitting the welcome route from the same client to get the welcome message:

GET http://localhost:8000/welcome

Hit the refresh route, and then inspect the clients cookies to see the new value of the token cookie:

POST http://localhost:8000/refresh

You can find the working source code for this example here.

More Repositories

1

javascript-design-patterns-for-humans

An ultra-simplified explanation of design patterns implemented in javascript
4,252
star
2

detective

🔎 A distributed application health monitoring library
Go
232
star
3

blog_example__go_web_app

Example repository for https://www.sohamkamani.com/blog/2017/09/13/how-to-build-a-web-application-in-golang/
Go
87
star
4

go-dependency-injection-example

An example to demonstrate the dependency injection pattern in Go
Go
78
star
5

go-session-auth-example

An example of session based authentication in Go
Go
76
star
6

go-oauth-example

Implementing OAuth 2.0 with Go
Go
61
star
7

node-oauth-example

Implementing OAuth 2.0 with Node.js
HTML
56
star
8

golang-kafka-example

Go
47
star
9

go-password-auth-example

Implementation of simple password authentication in Go
Go
42
star
10

code-eol

An extension to display line endings in VS Code
TypeScript
37
star
11

jwt-nodejs-example

JavaScript
35
star
12

supercat

An enhanced cat command for the terminal.
CoffeeScript
35
star
13

blog-example__redux-data

Example repository for http://sohamkamani.com/blog/2016/06/05/redux-apis/
JavaScript
33
star
14

three-object-loader

[DEPRECATED] NodeJS wrapper for Three.js' OBJLoader function
JavaScript
30
star
15

blog-example-go-context-cancellation

Example repository for https://www.sohamkamani.com/golang/2018-06-17-golang-using-context-cancellation/
Go
30
star
16

blog_example__go_web_db

Example repository for https://www.sohamkamani.com/blog/2017/10/18/golang-adding-database-to-web-application/
Go
25
star
17

crazy-awesome-json-viewer

A better JSON Viewer
TypeScript
24
star
18

d3-force-gravity

Implement gravitational attraction (or force-field-like repulsion) using d3-force
JavaScript
22
star
19

nodejs-test-without-library

A sample project demonstrating how to write, and run tests for Node.js without using an external library.
JavaScript
16
star
20

new-and-awesome

A curated list of new additions to the awesome lists 📖
14
star
21

nodejs-file-system-examples

JavaScript
14
star
22

node-express-mongo-example

This is a sample application demonstrating how to build an Node.js express RESTful application that integrates with MongoDB
JavaScript
14
star
23

nodejs-session-cookie-example

Example repo for my post on session cookie authentication with Node.js
JavaScript
13
star
24

nodejs-kafka-example

JavaScript
12
star
25

generator-nm-es6

Develop your own node modules in ES6 and ES2015 using babel.
JavaScript
10
star
26

mr-data-generator

JavaScript
10
star
27

detective-node

🔎 A distributed application health monitoring library
TypeScript
9
star
28

golang-graph-traversal

Go
9
star
29

golang-examples

Go
9
star
30

generator-webpack-quick

Yeoman generator to make quick prototypes and get up and running with ES6.
JavaScript
8
star
31

go-sql-database-example

Go
6
star
32

react-chat-example

An example repository demonstrating how to build a chat application with React and Node.js
JavaScript
6
star
33

go-job-processing-example

Go
5
star
34

node-http2-example

Example on how to implement an HTTP/2 client and server in Node.js
JavaScript
5
star
35

docker-busybox-example

Go
5
star
36

matrixify

JavaScript
4
star
37

go-concurrency-examples

Go
4
star
38

go-defer-example

Go
4
star
39

go-project-template

Go
4
star
40

nodejs-shell-command-example

JavaScript
4
star
41

blog-example__react-material

JavaScript
3
star
42

d3-projection-example

An example of how to use D3 projections to draw maps on your browser
JavaScript
3
star
43

spring-demo

Example repository demonstrating how to create a RESTful HTTP server application using Spring boot
Java
3
star
44

mvn-example

An example for how to run a java application on the command line with maven
Java
2
star
45

blog-example-react-combined-contexts

Example code for https://sohamkamani.com/blog/react/2018-07-26-combining-react-context/
HTML
2
star
46

java-jdbc-postgres-example

Java
2
star
47

golang-sql-transactions

Go
2
star
48

Monadify

JavaScript
2
star
49

blog-example__canvas-animation-framework

JavaScript
2
star
50

sohamkamani.github.io

HTML
2
star
51

blog-example__node-redis-cache

JavaScript
2
star
52

nodejs-sql-transactions

JavaScript
2
star
53

leap-motion__sample-slideshow

JavaScript
2
star
54

spring-security-examples

Java
2
star
55

docker-ms-demo

Go
1
star
56

me

About me
JavaScript
1
star
57

node-project-template

1
star
58

jspm-es6-react-bootstrap

JavaScript
1
star
59

nightwatch-demo

Sample code for automating and running tests using nightwatch.js
JavaScript
1
star
60

newblog

JavaScript
1
star
61

sample-modified-react-boilerplate

JavaScript
1
star
62

express-boilerplate

JavaScript
1
star
63

d3-force-gravity__demo

1
star
64

javascript-builder-example

How to use the builder pattern in Javascript
JavaScript
1
star
65

weather_app

JavaScript
1
star
66

java-bigquery-example

Java
1
star
67

javascripting

Learn JavaScript by adventuring around in the terminal.
JavaScript
1
star
68

blog-example__redux-counter

JavaScript
1
star
69

blog-example__snake

A game of snake for the browser
JavaScript
1
star
70

three-objmtll-loader

NodeJS wrapper for Three.js' OBJMTLLLoader function
JavaScript
1
star
71

img2svg

Python
1
star
72

create-react-app-boilerplate

Boilerplate generated from create-react-app (https://github.com/facebookincubator/create-react-app) with SASS and custom eslint configuration loaded
JavaScript
1
star
73

butter-seo-ssg-examples

HTML
1
star