In Angular 6 when you want to create a web application that has login functionality, you probably will want to have protected routes too.
To have protected routes, we have to implement CanActivate interface to create some kind of guard mechanism.
Our login page and its component:
You are seeing ApiService, CustomerService, and Router injected from the constructor. Let's describe them:
ApiService:
For this tutorial’s login functionality, I used a free dummy API web service named ReqRes. ApiService class injects HttpClient and provides me a login() method so I can call this method from anywhere of the application. …
There are lots of patterns to choose when developing software, such as Test Driven, Behaviour Driven or even Document Driven Development. But now, we are witnessing very dangerous type of development type, it’s Hype Driven Development.
Hype Driven Development can be seen in it’s environment with different shapes, I mentioned some of them below.
Just because others are “using” blockchain, you don’t have to use a blockchain. Examine the flowchart below to see if you need a blockchain.
Just because others are using GraphQL, you don’t have to convert your REST web services to it. GraphQL is not a replacement for REST. …
Recently I was configuring JWT authentication using Asp.NET Core 2.0 but with the latest update from 1.0 to 2.0, there was no tutorial or documentation, so I’m sharing.
In this post, we will use Entity Framework Core with MySQL, and Identity with JWT. So, it will be a little long post.
If you don’t know what is JWT, check this introduction.
The source project is available at github: https://github.com/ozgurrgul/WebApiJwt
Let’s create a new project for our WebApiJwt example project:
# mkdir WebApiJwt
# cd WebApiJwt
# dotnet new webapi
Our project will be created in a few secs.
First, we will start with connecting MySQL to our application, but before that open the project using your preferred IDE, I’ll use Rider since I’m on a Mac OS. …
About