Giter Club home page Giter Club logo

Comments (4)

tigercl avatar tigercl commented on June 26, 2024 1

@zmstone But EMQX documentation does not mention that the placeholders supported by JWT authn are different from other authn: authentication-placeholders

from emqx.

tigercl avatar tigercl commented on June 26, 2024

After this issue is fixed, there is still a risk of crash.

In function replace_placeholder of module emqx_authn_jwt.erl:

replace_placeholder(L, Variables) ->
    replace_placeholder(L, Variables, []).

replace_placeholder([], _Variables, Acc) ->
    Acc;
replace_placeholder([{Name, {placeholder, PL}} | More], Variables, Acc) ->
    Value = maps:get(PL, Variables),
    replace_placeholder(More, Variables, [{Name, Value} | Acc]);
replace_placeholder([{Name, Value} | More], Variables, Acc) ->
    replace_placeholder(More, Variables, [{Name, Value} | Acc]).

If there is no corresponding key in Variables, then maps:get(PL, Variables) will crash, as mentioned in Issue#13253, this is possible when fail_if_no_peer_cert is set to false.

from emqx.

zmstone avatar zmstone commented on June 26, 2024

This is not a bug, but a feature request.
JWT authn only supports placeholders for clientid and username to check against the JWT claims.
A workaround for now is to use peer_cert_as_username or peer_cert_as_clientid.

from emqx.

tigercl avatar tigercl commented on June 26, 2024

I found it: JWT AuthN

image

Maybe it's time to support it.

from emqx.

Related Issues (20)

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.