Thursday, September 12, 2019

JSON Web Token with ASP.NET Web API and Angular

What is Json Web Token (JWT)


JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. 

In simple terms, we use these tokens, to authenticate and authorize requests which are made over the internet and also to share information in forms of object typically known as Claims. You can know more in detail about Jwt on there official website.

In this article we are going to implement a simple login page in Angular, which will call an Web API endpoint to authenticate a user. If the provided credentials are authenticated, the server return a JWT token, which the client (i.e. Angular app in our case) uses for further requests involving secure transmission.

Firstly, we are going to implement the back end service which will generate the token for the first request and validate it for any further requests.

Note: I will provide a link to code base at the end of this article

Backend with Asp.Net Web API

Step 1: Create an empty Asp.Net Web API Project and add the following Nuget Packages:
  • Microsoft.AspNet.Cors
  • System.IdentityModel.Token.Jwt
  • Microsoft.Owin.Security.OAuth
  • Swashbuckle
Step 2: Create a new class named "Jwt_Authentication", which will act as the middle ware to generate the JWT token.


using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;

namespace AngularJwt_Api.Business
{
    public class Jwt_Authentication
    {
        private static string Secret = "ERMN05OPLoDvbTTa/QkqLNMI7cPLguaRyHzyg7n5qNBVjQmtBhz4SzYh4NBVCXi3KJHlSXKP+oi2+bXr6CUYTR==";
        public static string GenerateToken(string username)
        {

            DateTime issuedAt = DateTime.UtcNow;
            DateTime expires = DateTime.UtcNow.AddDays(7);


            var tokenHandler = new JwtSecurityTokenHandler();

            ClaimsIdentity claimsIdentity = new ClaimsIdentity(new[]
            {
                 new Claim(ClaimTypes.Name, "UserName"),
                new Claim(ClaimTypes.Email,"user@yopmail.com"),
                new Claim("DisplayName", "User"),
                new Claim(ClaimTypes.Role, "admin")
            });

            var now = DateTime.UtcNow;
            var securityKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(System.Text.Encoding.Default.GetBytes(Secret));
            var signingCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(securityKey,
                Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256Signature);


            var token =
                (JwtSecurityToken)
                 tokenHandler.CreateJwtSecurityToken(issuer: "http://localhost:51888", audience: "http://localhost:400",
                    subject: claimsIdentity, notBefore: issuedAt, expires: expires, signingCredentials: signingCredentials);
            var tokenString = tokenHandler.WriteToken(token);

            return tokenString;
        }

    }
}

This method will be called, once the credentials have been verified and the token needs to generated in order to send back to the client. In the real world scenario, Claims will have the details of the logged in user, and the Issuer and Audience Url's will be of the server and client application.

(Note, these will be different for you based on the port on which you API and Angular project are hosted)

Step 3: Create a simple model class to store the incoming request from the client. I have created a class named LoginModel.cs having two string properties Username and Password.

Step 4: Now we will be create the Controller which will have the logic to implement the authentication and call the GenerateToken method we created above.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using AngularJwt_Api.Models;
using AngularJwt_Api.Business;
using System.Net.Http;
using System.Net;
using System.Text;
using System.Web.Http.Cors;

namespace AngularJwt_Api.Controllers
{
 
    [EnableCors("*","*","*")]
    public class LoginController : ApiController
    {
        [HttpPost]
        [AllowAnonymous]
        public IHttpActionResult Authenticate([FromBody]LoginModel login)
        {
            bool isUsernamePasswordValid = false;

            if (login != null)
                isUsernamePasswordValid = login.Password == "admin" ? true : false;

            if (isUsernamePasswordValid)
            {
                string token = Jwt_Authentication.GenerateToken(login.Username);
             
                return Ok<string>(token);
            }
            else
            {
                return BadRequest("Login failed, invalid Username or Password.");
            }
        }

        [AuthorizeJwt]
        [HttpGet]
        public HttpResponseMessage GetSecureValues()
        {
            return this.Request.CreateResponse(HttpStatusCode.OK,
                        new { content = "Secure Content Returned" });
        }
    }
}

Here, we have two API endpoint, one which authenticates the user and the other which we will discuss later. The Authenticate method receives the LoginModel from the client and first the credentials are verified. For now we are simply matching the password but practically here we will make a call to the DB and get the credentials verified.

If the user is authenticated, the GenerateToken class is called with Username as parameter which is used in claims. You should pass on the actual User object to generate the claims.

Do remember to EnableCors in your project otherwise your angular application will not be able to communicate with the Api application.

We are all set to test are token generation logic through swagger. If you have not used Swagger before, it is a useful tool which generates documentation for your endpoints and gives you an interface to test them. It can be easily added to the project using Swashbuckle and then be accessed using /Swagger in the url of your application


Swagger to Generate Json Web Token in Asp.Net Web API


In the second image, we can see that our API return the JWT token in the Response Body. We will now move on to implementing the validation logic for incoming requests with these token.

Step 5: Create a new class names "AuthorizeJwtAttribute.cs". We will use this class to implement a custom Authorize Attribute to monitor, fetch, decode and validate the token.


using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;

namespace AngularJwt_Api.Business
{
    public class AuthorizeJwtAttribute : AuthorizeAttribute
    {
        private static string Secret = "ERMN05OPLoDvbTTa/QkqLNMI7cPLguaRyHzyg7n5qNBVjQmtBhz4SzYh4NBVCXi3KJHlSXKP+oi2+bXr6CUYTR==";
        public override void OnAuthorization(HttpActionContext actionContext)
        {
            string token;
            if (!TryRetrieveToken(actionContext.Request, out token))
            {
                actionContext.Response =
                                     new HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized);
            }

            try
            {
                var now = DateTime.UtcNow;
                var securityKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(System.Text.Encoding.Default.GetBytes(Secret));


                SecurityToken securityToken;
                JwtSecurityTokenHandler handler = new JwtSecurityTokenHandler();
                TokenValidationParameters validationParameters = new TokenValidationParameters()
                {
                    ValidAudience = "http://localhost:50191",
                    ValidIssuer = "http://localhost:50191",
                    ValidateLifetime = true,
                    ValidateIssuerSigningKey = true,
                    LifetimeValidator = this.LifetimeValidator,
                    IssuerSigningKey = securityKey
                };
                //extract and assign the user of the jwt
                Thread.CurrentPrincipal = handler.ValidateToken(token, validationParameters, out securityToken);
                HttpContext.Current.User = handler.ValidateToken(token, validationParameters, out securityToken);
                base.OnAuthorization(actionContext);

            }
            catch (SecurityTokenValidationException e)
            {
                actionContext.Response =
                                     new HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized);
            }
            catch (Exception ex)
            {
                actionContext.Response =
                                      new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError);
            }


        }


        private static bool TryRetrieveToken(HttpRequestMessage request, out string token)
        {
            token = null;
            IEnumerable<string> authzHeaders;
            if (!request.Headers.TryGetValues("Authorization", out authzHeaders) || authzHeaders.Count() > 1)
            {
                return false;
            }
            var bearerToken = authzHeaders.ElementAt(0);
            token = bearerToken.StartsWith("Bearer ") ? bearerToken.Substring(7) : bearerToken;
            return true;
        }


        public bool LifetimeValidator(DateTime? notBefore, DateTime? expires, SecurityToken securityToken, TokenValidationParameters validationParameters)
        {
            if (expires != null)
            {
                if (DateTime.UtcNow < expires)
                {
                    return true;
                }
            }
            return false;
        }
    }
}

Here in this class, we first retrive the token using the common Secret which we used while creating the token as well. Then we provide the parameters and use the inbuilt functions to validate the token.

LifetimeValidator function is implemented to check the expiry of our token. We have implemented it to be for 7 days but in real time it is somewhere around 20 mins to 30 mins in most of the applications.

We will now utilize the GetSecureValues function to use the custom attribute just created to limit the endpoint to bearer of our Jwt token.

Json Web Token in Asp.Net Web API implemented

test the endpoint for our token through Postman, move over to the Auth tab and select the Bearer Token from the Type dropdown. Enter the token and click on Send button.

So, our API is working as expected. We have now generated and validated a Json Web Token in our Web Api project.

Client Application with Angular

Step 6: We will now create a client application using Angular 8 in Visual Studio Code and consume our API. Follow the image below and create two components login-app and nav-bar, a model named login-model and a service to communicate to our Api named login-service.

Note: You can ignore nav-bar component and all other html code and create a simple form as long as it can take a username and password as input from the user.


Angular project structure to implement Json Web Tokens

login-model.ts


export class LoginModel {
  public  Username:string = "";
 public   Password:string = "";
}

login-app.component.ts

Here we will create a reactive form in angular to take in Username and Password from the users and on click of Submit button call the service class to communicate with the API. We have also implemented basic validation messages in the form.

The console.log method will help us showcase the values we entered and response we get back from the service once we complete the implementation.

Finally we will store the token returned in either browser local storage or session storage. One stored it will be available in the memory from where it can be fetched and added in headers for all further requests.

import { LoginServiceService } from './../login-service.service';
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators, FormControl} from '@angular/forms';
import {MatButtonModule} from '@angular/material/button';
import { LoginModel } from '../login-model';


@Component({
  selector: 'app-login-app',
  templateUrl: './login-app.component.html',
  styleUrls: ['./login-app.component.css']
})
export class LoginAppComponent implements OnInit {

  loginForm : FormGroup;
  loginmodel : LoginModel = new LoginModel();
  
  constructor(
    private formBuilder : FormBuilder,
    private loginService : LoginServiceService
  
  ) { }

  ngOnInit() {
    this.loginForm = this.formBuilder.group(
      {
        username : ['',Validators.required],
        password : ['',Validators.required]
      }
    );
  }

  get(key:string) : string
  {
    return this.loginForm.controls[key].value;
  }

  onSubmit() : void{
    console.log(this.loginForm.value);
    console.log(this.get('username'));
    console.log(this.get('password'));

   
    this.loginmodel.Username = this.get('username');
    this.loginmodel.Password = this.get('password');
    
    this.loginService.AuthenticateUser(this.loginmodel)
        .subscribe((response) => {
            console.log(response);
            localStorage.setItem('token', response.toString());
            sessionStorage.setItem('token', response.toString());
        })

  }

}

login-app.component.html

Basic Angular form created using Bootstrap. We have also used a simple Angular Material button for the Submit, but in case you have not worked with them before it is easier and faster to work with default bootstrap buttons for the purpose of this article.

<div class="card col-md-4 login-div offset-md-4">
      
    <h5 class="card-header">Login into the App!</h5>
   <div class="form-div card-body">
    <form [formGroup] = "loginForm" (ngSubmit) = "onSubmit($event)">
        <div class="form-group">
            <input type="text" formControlName= "username" class = "form-control" placeholder="UserName">
            <div class="error has-error alert-danger errorDiv" *ngIf = "loginForm.controls['username'].errors
            && loginForm.controls['username'].touched">
                               
                <div>Username is required</div>
            </div>
         </div>
         <div class="form-group">
            <input type="text" formControlName= "password" class = form-control placeholder="Password">
            <div class="error has-error alert-danger errorDiv" *ngIf = "loginForm.controls['password'].errors
            && loginForm.controls['password'].touched">
                <div>Password is required</div>
            </div>
         </div>
         <div>
         <button mat-raised-button color = 'primary' type="submit">  
            Login
        </button>
            <span style="float: right; margin-top: 12px">Forgot Password</span>
        </div>
    </form>
   </div>
  
</div>

nav-bar.component.ts (Optional )


import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-nav-bar',
  templateUrl: './nav-bar.component.html',
  styleUrls: ['./nav-bar.component.css']
})
export class NavBarComponent implements OnInit {

isLoggedIn: boolean

  constructor() { }

  ngOnInit() {
    this.isLoggedIn = false;
  }

}

nav-bar.component.html (Optional )


<nav class="navbar navbar-expand-lg navbar-light" style="background-color: #ffc048">
        <a class="navbar-brand" href="#">Angular Jwt App</a>
       
        <div class="collapse navbar-collapse navList" style="overflow: hidden;">
          <ul class="navbar-nav">
            <li class="nav-item" *ngIf = "!isLoggedIn">
              <a class="nav-link" href="#">Login</a>
            </li>
            <li class="nav-item" *ngIf = "isLoggedIn">
             <a class="nav-link" href="#">Hello</a>
            </li>

            <li class="nav-item mr-auto ml-2 mt-lg-0" style="margin-left: 2%">
              <a class="nav-link" href="#">Logout</a>
            </li>
        </ul>
        
        </div>
      </nav>

    

login-service.service.ts

Here we use the HttpClient module in Angular to call the method in our Api which returns the token if the user is authenticated. This method is subscribed in the login-app.component.ts

import { LoginModel } from './login-model';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
//import {Response, RequestOptions, Headers } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';  
import { Observable } from 'rxjs';  

@Injectable({
  providedIn: 'root'
})
export class LoginServiceService {

  base_url = "http://localhost:51888/api";
  loginModel : LoginModel;
  constructor(private http: HttpClient) { }

  AuthenticateUser(login : LoginModel){
   
    return this.http.post(this.base_url + "/Login",login)
  }

}

app.module.ts


import { LoginServiceService } from './custom-components/login-service.service';
import { LoginModel } from './custom-components/login-model';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
//import { HttpModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LoginAppComponent } from './custom-components/login-app/login-app.component';
import { NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatButtonModule} from '@angular/material/button';
import {MatIconModule} from '@angular/material/icon';
import { NavBarComponent } from './custom-components/nav-bar/nav-bar.component';
import { HttpClientModule } from '@angular/common/http';


@NgModule({
  declarations: [
    AppComponent,
    LoginAppComponent,
    NavBarComponent,
    
      ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ReactiveFormsModule,
    BrowserAnimationsModule,
    MatButtonModule,
    MatIconModule,
    HttpClientModule   
  ],
  providers: [LoginModel, LoginServiceService],
  bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html


<app-nav-bar></app-nav-bar>

<app-login-app></app-login-app>

No changes are required in the app.component.ts file.

Angular App to implement Json Web Token with Asp.Net Web Api

We can now use the dummy credentials we have hard coded in our Api to test if our client app work and if the token is saved in the cookie and local storage of the browser

Json Web Token returned from Asp.Net Web Api in Angular

Json Web Token stored in browser storage

Summary

In this article we have successfully implemented Json Web Token based authentication in Asp.Net Web Api using an Angular application as a client. It is the basic skeleton above which you can build any enterprise level application.


Note: To install the Angular dependencies, open the project in VS Code and run "ng install" followed by "ng serve"

Monday, January 21, 2019

Why is Samsung Launching the M Series ?

Samsung M Series


Samsung has distanced itself from the latest design changes which were first introduced with the launch of iPhone X and has till date continued to have the normal infinity display without any notches. However, Samsung is all set to the launch its new M series at the end of this month which will have the latest trending display style and an attractive price tag. But the question here is why Samsung has suddenly decided to launch such devices focusing the Indian market?

Samsung M Series as confirmed by its Indian VP will cost in the range of Rs 8000 to Rs 20000 with prices for Samsung M10 and Samsung M20 already leaked. The key point is that they are trying to get hold of a segment in the market which they have completely given up for the past few years.

If you go back 4 or 5 years it was Micromax which slowly took over the entry level smartphone segment and then when the Chinese companies entered the market, things totally changed. Xiaomi, Honor, Oppo, ViVo etc have totally taken over the sub Rs 25000 market cap. They have focused on bringing the latest design with great power and much importantly all packed in great value for money price tag. On the other hand Samsung still continues the classy but traditional design and specs which don't compete with the Chinese offerings.

Whether or not they are able to succeed and compel people to buy their smartphones in every available price segment is a thing to look out for but yes, the existing market leaders will surely have some headache with the arrival of Samsung M Series.

Check Out the Samsung M Series on Amazon India

It seems Samsung have finally realized that the market for high end premium phones is much less than that of the entry level phones and if they don't adapt they will be the only one to blame. With the M Series, Samsung is bringing dual and triple camera phones with 5000 mAh battery, fast charging, water drop notch design and a price tag which would help them grow.

The M series seems to be a desperate attempt from Samsung to get back into the highest selling market segment. They have already roped in famous YouTubers like Technical Guruji for promotions with launch day unboxing and giveaway in New Delhi which seems to be a very effective marketing strategy considering their tons of YouTube followers.

Monday, January 14, 2019

10 Best Blogging Tools for Beginners

10 Best Blogging Tools for Beginners


Wondering what are some of the best blogging tools for you to start with your blogging career? Here I have a list curated with just what you need to help grow your blog both in terms of content and traffic.

Although some of the items mentioned in this list are paid, still their free versions that are more than capable to solve all your initial problems to start with. Once you start earning then you can move to some more advanced and paid alternatives which offer much more but those are not of concern in this post.

AnswerThePublic 

AnswerThePublic lets you find the questions that are being asked most by the people. So just head over to the website and enter your niche or the area about which you wanna blog, and this will give you tons of questions each being a post idea on its own.

Canva 

Again something which will help most of you out there, and especially those who are not that good with Photoshop or other advanced editing tools in order to create beautiful images and banners to be used in your blog post. The free version will be more than enough to get what you need. The banner image used above has been also created through Canva itself.

Google Analytics

Analytics is one of the must-have tools for every blogger out there. You cannot grow your blog until and unless you know, who is reading your blog and what they like on it. All such metrics help you decide content which suits more to the audience which eventually lets in more engagement and traffic


Flipboard

Flipboard offers millions of active users out there who can be your potential readers. Get the Flipboard chrome extension and start submitting your blogs on it to publish it to a wide range of people who actually love to read such content. A platform on which you should surely share your work.

Keyword Everywhere

Although Keywords Everywhere is not 100% accurate, still this free chrome extension widely helps you in getting the keywords you can target to rank on your blogs. There is no way you are going to get your page ranked on Google if you are not using specific keywords that users are searching for.


Unsplash

Copyright is a major issue on the internet and in the end, you don’t want one of your highly successful blog post to be taken down by Google just because you used someones else image. The best way is to create your own using tools such as Canva or Photoshop but still you will have to go over to internet every now and then to look for something and Unsplash offers thousands for free images to get you sorted

Grammerly

Again and essential for every blogger out there. No matter how careful you, making spelling or grammar mistakes is obviously going to occur. Grammerly's chrome extension solves this problem. Once installed the free version itself tracks the content you types, highlight the spelling and grammar mistakes and even suggest the correct words. You should not start blogging without it.

IFTTT

Everyone understands the power of social media and with tons of those out there, it is very difficult to manage each one of them every time you write a blog. Solution? Head over to IFTTT and just automate all these, so when you write a new blog it will be directly posted everywhere you want, like Twitter, Facebook, Tumblr, Reddit, etc

Google Keep

A note-taking app which can be accessed on all platform is a must for every blogger. You don’t know when something strikes in your mind which can turn into a great viral post. Have Google Keep handy and take notes of anything that comes in your mind and never forget any idea.

Optimizilla

If you have been researching about blogging you know the importance of optimized images on the blog, they are SEO friendly and they significantly lower the load time of website which is a huge factor in deciding the traffic. Optimizilla is a free tool that lets you compress images and use them in your blog. The image quality is not compromised and you have what you need.

So there it is, these are my 10 best blogging tools for beginners. Use them in your blogs and you would surely see improvements from day one. Happy Blogging !!!!

If you think I missed a worthy contender here, feel free to comment and help the other bloggers out there.

Friday, January 11, 2019

How To Add Google Analytics to Blogger

Add Google Analytics to Blogger

Although not necessary but it highly recommended that you Add Google Analytics to Blogger blog or any other website. Google Analytics is free web analytics tool offered by Google which can help you track each and everything related to you website including, visitors, their locations, devices, demographics, session duration, traffic sources and much more. Follow the steps below to easily add Google Analytics to Blogger.


1. Head over to the Google Analytics homepage and login using the Google account.

2. Scroll down and click on Admin from the left side panel

Move to Admin Section to Create Account

3. Click on Create Account and enter details like Website's name, URL etc

Create Account for you Blogger

4. Select all the check boxes and click on Get Tracking ID

Generate Tracking ID on Google Analytics

5. Copy the Tracking Code and head over to your Bloggers account

Copy Tracking Code

6. Login into your Bloggers dashboard and click on Theme and then Edit HTML

Paste The Tracking Code to Blogger

7. Paste the copied tracking code just below the "<head>" tag and save you theme to add Google Analytics to Blogger 

Have any doubts ? Feel free to comment and we will be happy to help !!!


Thursday, January 10, 2019

Cred.Club : The Credit Card Bill Payment App


Cred.Club : The Credit Card Bill Payment App

Kunal Shah who earlier found the highly successful FreeCharge app recently launched his latest venture called Cred.Club, an invite exclusive credit card bill payment app which rewards users for paying their credit card bills.

I have been using this app for nearly a month now and I wanted to write something about it as it is first of its kind app and apparently not many are still aware about it even though it has already raised over $25 million in funding.


People using Credit Cards are aware about the pain it is to actually pay their bills and especially if they don’t have an account in the bank to which their card belongs to. You either use payment gateways like Billdesk or do an account transfer which sometimes takes 2 to 3 working days to reflect.

Cred.Club Application Screenshot


With Cred, this turnaround time is relatively zero as all of your payments are credited within minutes through IMPS, which is a huge relief. So its ticks the basic requirement of an app, "solving a real world problem". In order to register on the app you just need to use the registered mobile number and then Cred will fetch all the connected credit cards. However as of now to use the Cred App you will have to have a credit score of 750 and above. Once the card details are fetched, some basic details need to be provided post which, Cred.Club deposits Rs 1 in your card for verification purpose.


Now, on the home screen you can see your Credit score calculated via Experian and CRIF. Detailed report can also be seen for free which will usually cost you around Rs 500 if you ask your bank for it. You can directly proceed to paying of bills, which can be paid in full or any custom amount as well.


Once the payment is made your wallet gets credited with exactly the same amount of Cred Coins as the bill amount paid by you, which can be further used against the various rewards Cred offers in association with its partner merchants. Like for example, I got a flat Rs. 600 discount voucher on Ixigo. You also get two scratch cards per transaction like those in Google Pay but here you will have to burn you Cred Coins in order to reveal the amount. Any amount won through these cards are directly added to your credit card account.


Also Read : Kill The Bill with Kunal Shah's Cred

Other important functionality of the app is the way it shows up your Credit card statement. Now in order to use this, you will have to grant Cred app access to your email which can be revoked any time. Along with the entire statement it also distributes your expenditure into categories like Shopping, Travel, Wallets, etc. You can further drill down into these categories like for Shopping it will show all the merchants or website were you have made these transactions. Few of my friends found this functionality to be quite scary as it got all their data but some might really like these in order to know their spending patterns.


Pros and Cons of the Cred App


All these useful features coupled with a beautiful UI and hassle free experience really enhances the way this app solves the credit card bill payment problem. For reference, some of the sample offers which you can redeem using your Cred Coins are shown below.




Wednesday, January 9, 2019

How To Setup Custom Domain on Blogger

How To Setup Custom Domain on Blogger

It is highly important that you have a own domain associated with your blog instead of the free sub-domain of your platform and Bloggers allows you to link your custom domain for free unlike all other portals. Here I have listed the step by step process to setup custom domain on Blogger.

1. Login to your bloggers account and navigate to Settings >> Basics and scroll down to the Publishing section

Publishing the Blog Address on Blogger

2. In case you have not yet purchased a meaningful custom domain for your blog then you can click on Buy a domain button or else you are good to go through, so click on +Set up a third party URL for your blog

3. Enter your domain in the space provided and click on Save button which brings up addition details which are required to actually authorize you as the owner of the domain provided.

Setting up custom domain in Blogger

4. Here the CNAMEs are provided which you will have to link on the website of the registrar from which you purchased your domain.

5. Login in to your domain provider account and head over to the DNS section of the domain you are using. Here I am using GoDaddy for an example.


Manage DNS in Domain Provider
Also Read : SEO Basic Tips For Beginners 

6. Click on the ADD button at the bottom right corner and select Type as CNAME form the dropdown. Enter the value of Host and Points to as shown on your blogger dashboard.


Add New Values to DNS Host

7. Repeat the above step for the second value shown on your blogger dashboard as well and save the changes.

8. Wait for few minutes and head over to your bloggers dashboard and click Save button again. And there it is you have now successfully authorized yourself as the owner of the custom domain and linked your blog to that domain.

One more important step is remaining which is to make sure your custom domain works with or without www attached to it. For this head over back to your domain provider and scroll down to the Forwarding section.
Forwarding your custom domain
Click on Add adjacent to the Domain. In the Forward To section enter you domain name with www. before it and click on Save button.
Forwarding your custom domain to www

You have now successfully completed the entire process to setup custom domain on blogger. Try entering the same in browser and you will redirected to you original bloggers blog. Once you are done with this you will most likely have to take care of the basic SEO settings which are really useful for getting that traffic from google to your blog.

Also Read : The Only Guide You Need To Setup Blogspot Custom Domain

In case you face any issues feel free to comment and I will be happy to help.

Must Have Apps in Smartphones [India]

There are millions of apps on both Google Play and the App Store but not all are useful for everyone in their day to day lives. Here I have curated a list of must have apps in smartphones specially for people living in India.
Must Have Apps

Google Suite:

Yes, most of the phones come pre-installed with the google apps but still if you are using an iPhone you would have to go and separately get few of them. Chrome, Gmail, Google Maps, Google Drive, Youtube and Keep are the must have apps on the phone and I don't think I need to mention their benefits. You just need to have them plain and simple.

Paytm:

Paytm has grown to be the most widely used wallet service in India. Paytm has efficiently decreased the need to carry change and specially cash which is revolutionary in Indian scenario. The app provides great user experience and the benefits are numerous. Definitely , Paytm Karo!

Goal/Cricbuzz:

It’s a proven fact that Indians are crazy about sports specially cricket and football. Assuming you would like to track it on the go, Cricbuzz and Goal are the best options available by far.

WhatsApp:

Again, there are tons of instant messaging apps available, but the user base of WhatsApp is still the highest. WhatsApp has crossed all boundaries in order to make chatting easier like never before. Sense its popularity, earlier we used to say "send me a SMS" but now it has changed to "WhatsApp me".

CamScanner:

One of the most useful apps available out there. The options to scan document and share them in desired format along with accessibility across all platforms make it a must have.

Also Read : Features You Might Miss on Moving From Android to iOS

Snapseed/PS Express:

These two by far are the best photo editing apps out there. With proper time and efforts you would be surprised with the output you can generate through these apps.

Ixigo:

With great offers and cashback program Ixigo is one of the best options to book your travel itinerary. With over 100 million download this again is a must have.

Zomato:

Eating again is a thing Indians love and with Zomato finding places for us has never been easier. I myself never go to a restaurant without checking their ratings and reviews on the app. Also recently I have started ordering food much more from Zomoto compared to the other platforms. Moreover, they offer great discounts
throughout the year.

Amazon:

Again a must have shopping app on your phone. I end up ordering even small day to day items from here, thanks to their prompt delivery. And if you get their prime subscription then it has much more to offer with quicker deliveries, early access, discounts etc along with their streaming services, the Amazon Prime and Amazon Music app. Both of them offer remarkable content.

Wikipedia:

Most often when you search something on internet you end up on Wikipedia reading about it. The app offers great experience and readability and for sure should be there on your device.

VLC:

No need to mention anything about it. It is easily the most used media player on desktop/ laptops and same goes for the phones. These are even more useful for iPhone users as video syncing is easier with it.

BookMyShow:

A market leader in it’s domain, BookMyShow is the most likely the platform you are going to use for booking events and movie tickets and hence having its app installed will always be efficient.

Initially published on rajatsrivastava.com