Giter Site home page Giter Site logo

kong-plugin-jwt-auth-token-validate's Introduction

kong-plugin-jwt-auth-token-validate

Validates the audience and the issuer from a JWT.

How it works

When enabled, this plugin will verify the audience and the issuer from signed jwt. The plugin will look for the JWT in the Authorization: Bearer [token]</span header.

Install

Clone the repository and then from the cloned directory, as root:

# luarocks make --pack-binary-rock kong-plugin-jwt-auth-token-validate-1.0-1.rockspec

You can install it from luarocks : jwt-auth-token-validate rock package.

Docker

Build image:

# docker build -t kong:latest .

Start Kong

docker run -d --name kong   --network=kong-net   -e 'KONG_DATABASE=postgres'   -e 'KONG_PG_HOST=kong-database'   -e 'KONG_PROXY_ACCESS_LOG=/dev/stdout'   -e 'KONG_ADMIN_ACCESS_LOG=/dev/stdout'   -e 'KONG_PROXY_ERROR_LOG=/dev/stderr'   -e 'KONG_ADMIN_ERROR_LOG=/dev/stderr'   -e 'KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl'   -p 8000:8000   -p 8443:8443   -p 8001:8001   -p 8444:8444   kong:latest

Configuration

Post via curl

curl -X POST http://localhost:8001/services/<my_service_id>/plugins \
--data 'name=jwt-auth-token-validate' \
--data 'config.issuer=<my_issuer_url>' \
--data 'config.audience=<my_audience_id>'

Schema

form parameter required description
issuer true Url from the JWT issuer
audience true Your application id

kong-plugin-jwt-auth-token-validate's People

Contributors

condezero avatar ellull avatar jcorrius avatar vjtm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

condezero binhbt

kong-plugin-jwt-auth-token-validate's Issues

how does it validate signature?

Hi,

Can it validate a RS256 signed token? If yes, where can I add public key?

Sample token:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJleHAiOjE2MDMyNTEyODYsImlhdCI6MTYwMzI0NzY4NiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDAwIiwibmJmIjoxNjAzMjQ3Njg2LCJzdWIiOiJBQWR6WldOeVpYUXhMNkQ2WUtoMHJxdUJyWllPQXB5RTZaTkdvb3VBRlpLb1JwUllJaUdodmVPcGIwTzMwUjQvRVRwSG9LTEVCUGs2eURmc0twUzlpNmVydWRsUEtEejlkT2tDdUcxMWdNaVlDQkFmb2tNaldYMlBTV21kS2g1QzVjdUJqR0x5RHNydzRnbG5KbmtNamc9PSIsImF0dHIiOnsiZGlzcGxheU5hbWUiOlsiTW9ydHkgU21pdGgiXSwiZWR1UGVyc29uRW50aXRsZW1lbnQiOlsiTm9uZSJdLCJnaXZlbk5hbWUiOlsiTW9ydGltZXIiXSwibWFpbCI6WyJtc21pdGhAc2FtbHRlc3QuaWQiXSwicm9sZSI6WyJqYW5pdG9yQHNhbWx0ZXN0LmlkIl0sInNuIjpbIlNtaXRoIl0sInRlbGVwaG9uZU51bWJlciI6WyIrMS01NTUtNTU1LTU1MDUiXSwidWlkIjpbIm1vcnR5Il0sInVybjpvYXNpczpuYW1lczp0YzpTQU1MOmF0dHJpYnV0ZTpzdWJqZWN0LWlkIjpbIm1zbWl0aEBzYW1sdGVzdC5pZCJdfSwic2FtbC1zZXNzaW9uIjp0cnVlfQ.BHvqrIOsbwDOdXuQJ5ZGI52xenaTtfXIPrVVjLixVk5SSRMnQagmVhLXVycukmq0RzHYinVDeE92VicD2gi8JR3biDLzriJ9R2aDLew3lwHhX9e6XZNhn1hkZGpsV4-MARq3s9kVgRIcakZoUtrNjMUXJVHSFy9ijtSYas4uhQU

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.