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

function :crypto.hmac/3 is undefined or private #30

Open
mcfiredrill opened this issue Jul 29, 2021 · 4 comments
Open

function :crypto.hmac/3 is undefined or private #30

mcfiredrill opened this issue Jul 29, 2021 · 4 comments

Comments

@mcfiredrill
Copy link

I think the newer version of crypto.hmac has 4 arguments instead of 3 (OTP 20 and above?).

** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private
    (crypto 5.0) :crypto.hmac(:sha256, "xxxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxx")
    lib/json_web_token/algorithm/hmac.ex:35: JsonWebToken.Algorithm.Hmac.verify?/4
    lib/json_web_token/jws.ex:103: JsonWebToken.Jws.verified/3
    lib/json_web_token/jwt.ex:89: JsonWebToken.Jwt.verify/2
@Sgoettschkes
Copy link

I'm getting the same error, but :crypto:mac/4 is recommended:

** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private, use crypto:mac/4 instead

@alvinotienokelly
Copy link

Who has managed to resolve this.

@jarmo
Copy link

jarmo commented Mar 12, 2023

Stumbled upon the same problem. Too bad this is the first library mentioned at jwt.io for Elixir and it is not maintained nor working.

I ended up using Erlang's JWErl library. Pretty easy to use also from Elixir, is still maintained and works as promised. There's some lack of documentation if need to use some options, but it's possible to get this information from tests.

@datpt11
Copy link

datpt11 commented Sep 20, 2024

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants