Code Monkey home page Code Monkey logo

resty-autossl-jwt's Introduction

#OpenResty with lua-resty-auto-ssl and lua-resty-jwt

Build docker image:

docker build . -t resty-autossl-jwt
docker tag resty-autossl-jwt localhost:5000/resty-autossl-jwt
docker push localhost:5000/resty-autossl-jwt

Create a container from the image using the following command, with some notes:

  1. Use host network to avoid issue at high volume.
  2. Remember to set the secret for jwt.
  3. Provide your own nginx config files, e.g., add -v /yourcfgpath/nginx:/etc/nginx
  4. Make sure your 80/443 ports are not occupied.
docker run --name resty-autossl-jwt \
          --restart=always \
          --net=host \
           -e JWT_SECRET=testjwt \
           -p 80:80 -p 443:443 -d \
            localhost:5000/resty-autossl-jwt

To verify jwt with default setting, please issue a http request

curl -k --header "Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJyZXN0eS1hdXRvc3NsLWp3dCIsImlhdCI6bnVsbCwiZXhwIjpudWxsLCJhdWQiOiJqd3QiLCJzdWIiOiJ0ZXN0In0.G6d_ZKaO3mjZkdc3a41jmRVZF0uuUyfvQl3xZMryrzQ" https://localhost/jwt/

To verify jwt issued by Google firebase, please modify (e.g., nginx/conf.d/firebase.lua to match your firebase config), and issue a http request

curl -k --header "Authorization:Bearer "YOUR_GOOGLE_FIREBASE_JWT_TOKEN" https://localhost/jwtfb/

resty-autossl-jwt's People

Watchers

James Cloos 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.