Auth0_jwks - I made an Auth0 plug so you don't have to!

Welcome to the forum - and thanks for the contribution to the community :heart:

Quick notes

https://github.com/bechurch/auth0_jwks/blob/3584412a04ae8c5a1ed3be221cf51134db294155/lib/plug/validate_token.ex#L14-L21

Do you need to handle bearer not Bearer?

Note that “Bearer” is now case sensitive. Per original HTTP spec, auth scheme is case insensitive (RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication) however “Basic” and “Bearer” are exceptions (see RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage)

In my case, I usually just accept the good request (Bearer) - then you can simplify this by pattern match on the string - "Bearer " <> token = header

4 Likes