Skip to content

lokamaya/modJWT-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ModJWT FOR MODX 2.6+

A MODx extra to works with JSON Web Token (JWT)

Documentation: https://github.com/lokamaya/modJWT (next on this)

Bugs and Feature Requests: https://github.com/lokamaya/modJWT/issues

Discussions and Questions: MODx Community

This extra is now available on MODx repository that can be downloaded from MODx manager.


Installation

  • Download this extra from MODx manager
  • Install modJWT
  • After successfull installation: go to the default context in modx manager, find and edit sample page /modjwt/
  • Then go to system settings > modjwt. There are some default configuration like: Secret Key, Private Key, and Public Key.

Sample pages contain 1 HTML resource and 3 JSON pages. You can play around with it.


Authorization Header

If you are having trouble validating the Token, try adding the following line to your .htaccess configuration.

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Some hosting stripped out "Authorization" header from http request.


Writing RSA Key

Note: don't add passphrase

ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub

About

A MODx extra to work with JWT (JSON Web Token) based on Firebase/JWT.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages