This package has been deprecated

Author message:

WARNING: This project has been renamed to arc-macro-jwt. Install using arc-macro-jwt instead.

arc-macro-auth

1.0.1 • Public • Published

arc-macro-auth

Use JWT authentication with Architect HTTP APIs.

Ok..How?!

Install:

npm i arc-macro-auth

And add to your .arc-file:

@app
myapp

@auth
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 (--auth flags in @http are ignored)

@http
get / #Not secured
get /foo --auth #Secured with default scopes
get /bar --auth read:bar,... #Secured with specified scopes

@macros
architect/macro-http-api #Required until HTTP APIs are default in arc
arc-macro-auth

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

Readme

Keywords

none

Package Sidebar

Install

npm i arc-macro-auth

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

5.22 kB

Total Files

3

Last publish

Collaborators

  • thedersen