GithubHelp home page GithubHelp logo

guilhermerebelo / springboot2-jwt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sophea/springboot2-jwt

0.0 0.0 0.0 30 KB

springboot2 with JWT

License: GNU General Public License v3.0

Java 100.00%

springboot2-jwt's Introduction

Introduction

This project is about how to use spring security username/password from database and exchanging token using JWT

This is Spring Boot V2 Application for Securing a REST API with JSON Web Token (JWT). See more details : https://medium.com/@sopheamak/springboot-security-with-jwt-fca1446790ba

Technologies

  • Spring boot 2
  • JWT jjwt
  • Mysql
  • Database JPA

REST APIs

  • Register new user
curl -X POST \
  http://localhost:8080/register \
  -H 'content-type: application/json' \
  -d '{
"username":"test",
"password":"password"
}'
  • Login API to exchange token
curl -X POST \
  http://localhost:8080/auth/token \
  -H 'content-type: application/json' \
  -d '{
"username":"test",
"password":"password"
}'

response back 

{
    "token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0IiwiUk9MRVMiOlsiUk9MRV9VU0VSIl0sImV4cCI6MTU3ODE3ODI5NSwiaWF0IjoxNTc4MTYwMjk1fQ.gDMuDfp1_1kv729HrOWCskTm4rNCm7SSoniqDHZuRD5H1uUtFzbiktN9NVaTNaTvp14UqGavQygKhO3pTFOQJg"
}

springboot2-jwt's People

Contributors

sophea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.