Decode payload of JWT token
First, make sure you have the Polymer CLI installed. Then run polymer serve
to serve your application locally.
$ git clone https://github.com/discovery-tecnologia/dsc-polymer-jwt-decode.git
$ cd dsc-polymer-jwt-decode
$ npm install
$ npm install -g polymer-cli
$ polymer serve
Open browser: http://localhost:8080/components/dsc-polymer-jwt-decode/demo/
Install with:
$ bower i dsc-polymer-jwt-decode --save
Example usage:
<dsc-polymer-jwt-decode
id="jwtDecode"
token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcGktYXV0aCIsImlhdCI6MTQ5MjU2NzQzMywiZXhwIjoxNDkyNTc0NjYzLCJ1c2VyIjoiNThhYjg4MGIzYmY5MDQ0ODZmYjI4Yzk2IiwicHJpdmlsZWdlcyI6WyJhZG1pbiJdfQ.2XxAiWNdLC-aA9L_L5MmVmUlqmj9_ox0sJU8byhw1F8"
valid="{{isValid}}"
decoded-token='{{tokenPayload}}'></dsc-polymer-jwt-decode>
$ polymer test
Your application is already set up to be tested via web-component-tester. Run polymer test
to run your application's test suite locally.