Giter VIP home page Giter VIP logo

jwt-server's Introduction

JWT(JSON Web Tokens) Authorization - Server

What are JSON Web Tokens?

JWT

Setup

$ git clone [email protected]:webcyou-org/jwt-server.git

Server Framework List

and more...

Select Server Framework

  • Ruby on Rails 5
$ bundle install --path vendor/bundle
$ bin/rails db:create db:migrate
$ bin/rails db:seed
$ bundle exec rails s

Listening on tcp://localhost:3000

Use Gem

API EndPoints

Host

http://localhost:3000

EndPoints

url method details
/api/v1/user_token POST Create Access Token (User Login)
/api/v1/users POST Create new account
/api/v1/users DELETE User Logout
/api/v1/users GET Login User Show

Default User

name email password
daisuke.takayama [email protected] test123

CURL Test

Create Access Token (User Login)

$ curl -X "POST" "http://localhost:3000/api/v1/user_token" -H "Content-Type: application/json" -d $'{"auth": {"email": "[email protected]", "password": "test123"}}'

response

{"jwt":"eyJ0eXAiOiJKV1QiLCJhbG...."}

Login User Show

$ curl -X "GET" "http://localhost:3000/api/v1/users" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...." -H "Content-Type: application/json"

response

{"status":200,"user":{"id":1,"name":"daisuke.takayama","email":"[email protected]"}}

Open Browser

http://localhost:3000

and more...

development

SubModule

We store the front end source in the front end directory.

$ git submodule init
$ git submodule update

git clone & SubModule init

$ git clone --recursive [email protected]:webcyou-org/jwt-server.git

Author

Daisuke Takayama

License

Copyright (c) 2019 Daisuke Takayama Released under the MIT license

jwt-server's People

Contributors

panicdragon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jun-kooriyama

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.