Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support to verify the specified claims fields #69

Merged
merged 5 commits into from Apr 4, 2019

Conversation

@linjunjj
Copy link
Contributor

linjunjj commented Apr 2, 2019

Hello there, the JWT plugin can now verify the specified JWT claims.

Set auth.jwt.verify_claims = on to enable verify some specified fields:

# Enable verifying claims fields
auth.jwt.verify_claims = on

## Specify the `sub` claim must be equal to string "87891246"
auth.jwt.verify_claims.sub = 87891246

## Specify the `username` claim must be equal to string "user1"
auth.jwt.verify_claims.username = user1

## It also supports placeholders from MQTT CONNECT packet
## - %u: username
## - %c: password
##
## e.g. to specify the `username` claim must be equal to string "{{mqtt-username}}":
##        auth.jwt.verify_claims.username = %u
##
## i.e. If the username got from MQTT CONNECT is "user1", then the 'username' claim
##        must be equal to "user1"
priv/emqx_auth_jwt.schema Outdated Show resolved Hide resolved
src/emqx_auth_jwt.erl Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@HJianBo HJianBo self-assigned this Apr 3, 2019
@HJianBo HJianBo changed the title Add verify jwt payload [Feature] Support to verify the specified claims fields Apr 3, 2019
@turtleDeng turtleDeng merged commit 26a2f5a into develop Apr 4, 2019
@turtleDeng turtleDeng deleted the add_validate_payload branch Apr 4, 2019
gilbertwong96 pushed a commit that referenced this pull request Apr 4, 2019
Gilbert
[Feature] Support to verify the specified claims fields (#69)
PeiyiChi added a commit to TeamAlbi/emqx-auth-jwt that referenced this pull request Sep 18, 2019
* Merge with EMQ X

* Fix the module name

* Fixed conflicts

* Depends on emqx/emqx-enterprise project

* emqx_auth_jwt_config -> emqx_auth_jwt_cfg

* Update default secret

* Rm jwt.hrl

* Version 2.4

* Fix run fail

* Fix tests case for emqx_auth_jwt

* Depends on emqx/clique

* Version 2.4.3

* EMQX 3.0 UT

* Change lager to OTP logger

* Reduce dependencies size

* Update tag

* Update cuttlefish to v2.2.1

* Fix run test case fail

* Update Copyright to 2019

* Update deps version

* Update release version to 3.1

* Update deps version

* Update deps version

* Refactor makefile for new workflow

* Version from tags

* Format app.src

* Replace case catch with try catch

* Rm testing branch

* Fix unbound bug

* Update JWT for hooks

* Remove extra APIs

* Enlarge the exp timeout to 3s in common test

* Rename result -> auth_result

* [Feature] Support to verify the specified claims fields (emqx#69)

* Add verify jwt token payload

* Fix calling emqx_ct_helpers:start_apps/2 error (emqx#71)

* Depend emqx_ct_helper with tag

* Switch to rebar3

* Add travis ci and support branch transition

* Update default dependency branch to develop

* Support branch transition for release

* Add plugin type attribute

* Add metrics for auth (emqx#83)

* Add metrics for auth

* Set anonymous field once executing check (emqx#86)

* Fix read_pubkey case clause

* Update the auth hook

* Update copyright and define 'AUTH_METRICS' macro

* Update app file

* Update rebar.config
Anakin-Hao added a commit to TeamAlbi/emqx-auth-jwt that referenced this pull request Sep 19, 2019
Anakin-Hao added a commit to TeamAlbi/emqx-auth-jwt that referenced this pull request Sep 19, 2019
Anakin-Hao added a commit to TeamAlbi/emqx-auth-jwt that referenced this pull request Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.