arc-macro-jwt

2.0.1 • Public • Published

arc-macro-jwt

Use JWT authentication with Architect HTTP APIs (APIG HTTP Api only).

Install:

npm i arc-macro-jwt

Add to your .arc-file:

@app
myapp
 
@aws
apigateway http
 
@jwt
issuer https://example.auth0.com/ #Issuer of JWT
audience https://example.com,https://example2.com #Audience in the JWT
identitySource $request.header.Authorization #Where is the token source
scopes read:foo,write:foo #Not required
default false #Set to true to secure all routes (@jwt pragmas in .arc-config are ignored)
 
@http
get /
get /foo
get /bar
 
@macros
arc-macro-jwt

And add to individual .arc-config files for routes that needs auth:

@jwt
scopes read:bar,write:bar #Not required (use default scopes or none when not specified)

See AWS::Serverless::HttpApi/HttpApiAuth for more information.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i arc-macro-jwt

    Weekly Downloads

    8

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    4.42 kB

    Total Files

    3

    Last publish

    Collaborators

    • thedersen