Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Custom Authorizer - Get token from cookie

I'm currently building a web application whose backend is purely build in API Gateway/Lambda. I build a custom JSON Web Token (JWT) authorizer to authorize the users. At the moment I'm passing token in header field.

Unfortunately, I'm only able to define a header field in which the token is send to API Gateway.My applications stores the token in a cookie.

Is there any option to access the cookie directly so that it can authenticate using lambda.

For example:

Now I'm passing:-

method.request.header.Authorizer

But I need somehting like this :-

methods.request.header.Cookie

Any workaround ? Thanks!

like image 905
Sanket Gandhi Avatar asked Oct 13 '17 04:10

Sanket Gandhi


1 Answers

Now you should be able to access all the headers including Cookie header, using Custom Authorizers of the REQUEST type. Recently AWS introduced this feature to allow access to more than Token Header.

enter image description here

like image 122
Ashan Avatar answered Oct 21 '22 16:10

Ashan