How to Authenticate User in Symfony 5 by Jwt

Introduction Nowadays, when we are talking about web development, regardless of the type of application or the programming language, one of the first things that come to mind is how to authenticate users. There are many types of authentication ways for this purpose such as login form, oAuth, JWT, API token, etc. Reliability, security, easy to use and widely supported in many platform and languages make JWT one of the most popular authentication protocols in the web ecosystem. In this tutorial, we will learn how to implement JWT in Symfony 5 by using the firebase/php-jwt package and AbstractGuardAuthenticator class. There are some bundles or packages already out there like lexik/LexikJWTAuthenticationBundle that we can use but at the end of this tutorial, we will learn how can we implement and use Authentication Guard which in Symfony. ...

April 11, 2020 · 10 min · Saeed

What I Learned in 2018

Today is the last day of 2018. This year, at least for me, was full of exciting events with an abundance of interesting happenings, which I feel makes me a better person going into 2019. Here are some of my experiences in the past year. Loneliness can’t hurt you, if you don’t want Actually, I learned it a couple of years ago, but sometimes you can forget about something important so much that maybe it will not hurt you. Loneliness is one the most daunting challenges I have ever had in my life. From when I was a child until now, I’ve always felt lonely. But a couple of years ago, I asked myself why loneliness has the power to make me sad. Then I realized, if I couldn’t be happy with myself, I would never be happy with someone else. So I started to list all the things that would make me happy and then began to achieve them one by one. I was just curious, what was it like to be alone and happy at the same time. At first, it was hard not think about loneliness, but after a while I understood that I’m happy without even thinking about loneliness. Actually I learned to be my best friend and take care of myself, is would be the best thing I can do for myself because no one is going to do it for me. ...

February 2, 2019 · 4 min · Saeed

Simple auto deployer with PHP

How you deploy your projects? Are you using fancy things like Jenkins with lots of features and configuration that you don’t even know about? For one of my personal projects, I needed to have a deployment tools. I tried to install and configure Jenkins but there was no chance to make it up and running. So I decided to write my own, simple deployer with PHP. Git Hooks For this article we are using Git hooks. Git hooks are a script that Git runs before or after some events are triggered such as: commit, push, merge, creating a branch and so on. Although the equivalent of Git Hooks in web-based Git platforms such as Github, Gitlab or bitbucket are Webhooks, which instead of running a script, call a URL (usually in your server). ...

December 15, 2018 · 3 min · Saeed