CSRF Token in Lumen 5.4

Published 1 year ago by faisalsharif

Hi All, i am new in Lumen, i was read why Lumen 5.4 not supported CSRF token as they have classes support in Lumen 5.1 , should i down grade to Lumen 5.1 ?

Best Answer (As Selected By faisalsharif)
Ruffles

JSON Web Tokens is one of the possible options. The JWT Auth package is quite easy to use.

Ruffles
Ruffles
1 year ago (297,250 XP)

No, you shouldn't.

Lumen is mainly used for RESTful APIs since Lumen 5.2, so the views functionality was removed.

CSRF tokens are used in a session based traditional application while the RESTful APIs are stateless and do not use sessions.

faisalsharif

Thanks Ruffles , i appreciated , so what will be the best option of Restfull Api Authentication , Lumen Authentication Documentation not providing a detail

Ruffles
Ruffles
1 year ago (297,250 XP)

JSON Web Tokens is one of the possible options. The JWT Auth package is quite easy to use.

faisalsharif

Thanks Ruffles :)

faisalsharif

Ruffles sorry disturbing you , JWT Auth package have only guide for Laravel , how i configure in Lumen 5.4

thanks in advance

Ruffles
Ruffles
1 year ago (297,250 XP)

Please sign in or create an account to participate in this conversation.