You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JustAuthenticateMe AWS API Gateway Custom Authorizer Function
Introduction
JustAuthenticateMe offers simple magic link based authentication as a service for web apps.
This is a AWS API Gateway Custom Authorizer function that you can drop into your serverless backend to authenticate incoming
requests. It uses the JustAuthenticateMe Node SDK under
the hood to verify incoming requests and pass the user's email on to your endpoint handler.
You'll then want to configure this handler as a
Lambda Authorizer
for any of your API Gateway Endpoints that you'd like to only be accessible by authenticated users.
When configuring the authorizer, be sure to select the REQUEST type.
Sending requests
When sending requests to endpoints that are protected by this authorizer, include the ID token you get from JustAuthenticateMe in
the Authorization header after the keyword Bearer. It should look something like this:
When a request is authenticated successfully, this lambda returns a policy allowing the user access to any resource protected by
this authorizer. It also passes along the email address of the authenticated user to the handler of the API endpoint.
Specifically, a lambda handling an endpoint protected by this authorizer can access the user's email at
event.requestContext.authorizer.email.