Google 2 Step Authenticator – MVC 5.0 ASP.Net C#

Requirement : Implement google 2 step authentication in any existing MVC C# Project. Features : Highly Secure No need of internet to get OTP Code No cost for OTP code unlike SMS No need to wait long to get a code Both IOS and Android are supported Complete solution with source code available for download 30 Days cookie so no need to authenticate daily [Can be changed] Easily add or edit private secure code in web config. Enable 2 step feature from Web.config The session cookie is Encrypted for security purpose Source Code : Download complete source code from my repository: https://github.com/haneefputtur/GauthenticatorMVC5 Steps : Create a blank MVC Project Install Google Authenticator from Nuget Package 3. Add New Controller and name as LoginController Copy Below Code to controller using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.Configuration; using System.Web.Mvc; using System.Web.Security; using GAuthenticator.Models; using Google.Authenticator; namespace GAuthenticator.Controllers { public class LoginController : Controller { // GET: Login public ActionResult Index() { return View(); } public ActionResult Login() { return View(); } [HttpPost] public ActionResult Login(LoginModel login) { string message = “”; bool status = false; //check UserName and password form our database here string GAuthPrivKey = WebConfigurationManager.AppSettings[“GAuthPrivateKey”]; […]

» Read more

ESP-12E Based Weather Station – NodeMCU 12-E, BME280 and Yaler

Preface : Develop a Weather Station which can be accessed through the internet Advantage : Extremely low budget Easily available hardware Easy to configure Hardware Components Required : NodeMCU – ESP 8266-12E BME280 I2C or SPI Temperature Humidity Pressure Sensor Breadboard Internet Subscription Required : Yaler.net   Hardware Details ESP8266 – NodeMCU 12E     BME/BMP 280 Sensor Bread Board               Jumper cables                           Pin Configuration Pin Number D3 ESP — > SDA Pin BMP/BME 280 Pin Number D4 ESP — > SDB Pin BMP/BME 280 Pin Number 3V3 ESP — > VIN Pin BMP/BME 280 Pin Number GND ESP — > GND Pin BMP/BME 280 Online Subscription for Domain Send an email to get an account by paying their fee. Once you get the user account note down your Relay-Host and Relay-Domain   Install Arduino (if you dont have) from https://www.arduino.cc/en/Main/Software   After installation Open the Arduino software. Tools –> Boards –> Board Manager       You can also download the Yaler library files from https://bitbucket.org/yaler/yalercontrib/downloads/YalerESP8266WiFiServer.zip   Once download copy to Arduino Library folder make sure your folder looks like […]

» Read more

Secure your WhatsApp with 2 Step Verification today!

Hereis the tips to secure your whatsapp with 2 step verification. Why I need to secure? If you lose your mobile number for any reason like failed ID card registration or finishing the contract with service providers all your messages will not be available for the next subscriber of the same number. If the new subscriber cannot enter the pass code your number will be automatically removed from any previous subscribed groups. Usually if there is no 2 step pass code all your contents including pictures will be available to the next subscriber of your number without your consent. What 2 step will do? Once you enable 2 step authentication, WhatsApp will frequently make sure you are the real owner of the WhatsApp account. Also in case you change mobile device it will copy the previous content only after you enter valid passcode. How to Enable 2 Step Verification in WhatsApp ? Its very simple procedure and hardly takes 2 minutes to harness your whatsapp account privacy. Procedure for Android Users : Open Whatsapp –> Settings –> Account –> 2 Step Verification –> Enable Please keep note of the 6 digit passcode you have entered. In case you forgot the […]

» Read more

Easy Password validator for MVC C#

If you are developing an application in MVC C# use this code in your password model to make easy validation [Required] [DataType(DataType.Password)] [StringLength(100, ErrorMessage = “The {0} must be at least {2} characters long.”, MinimumLength = 8)] [Display(Name = “Password”)] [RegularExpression(“^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^a-zA-Z0-9])).{8,}$”, ErrorMessage = “Passwords must be at least 8 characters and contain at 3 of 4 of the following: upper case (A-Z), lower case (a-z), number (0-9) and special character (e.g. [email protected]#$%^&*)”)] public string Password { get; set; } This will impose following password policy Passwords must be at least 8 characters And Satisfy any of  3 from 4 of the following: upper case (A-Z), lower case (a-z), number (0-9) special character (e.g. [email protected]#$%^&*)

» Read more

Regx for Validating UAE Telephone Numbers

This is the regx which can be used to validate UAE contact numbers in your developments. In C# Use as below in your models [RegularExpression(“^(?:\\+971|00971|0)?(?:50|51|52|54|55|56|58|2|3|4|6|7|9)\\d{7}$”, ErrorMessage = “Enter Valid UAE Numbers”)] public string Mobile { get; set; } Verify and test this regx online : https://regexr.com/47qlv In other designs you can use this  ^(?:\+971|00971|0)?(?:50|51|52|54|55|56|58|2|3|4|6|7|9)\d{7}$      

» Read more

Integrating Google Recaptcha to Webid – Auction Script

Webid do not have built in support for new google Recaptcha . If use enable Recaptcha of webid your registration form may not work. To resolve this follow below steps.   Step 1 : Register for google Recaptcha https://www.google.com/recaptcha/admin Enter google username and Password   Once you register google will provide a site key , please make a note of it. Step 2 : Open the file themes/modern/global_header.tpl     .. If you are using different theme use concerned folder. Add This line exactly before the >/head> tag <script src=’https://www.google.com/recaptcha/api.js’></script> Step 3 : Open themes/modern/register.tpl   and replace below code   Replace below code block after replacing the site key <div class=”form-group col-lg-12″> <div class=”capchabox”>{CAPCHA}</div> </div> <!– CAPCHA CODE –> <div class=”form-group col-lg-12″> <div class=”g-recaptcha” data-sitekey=”SITE KEY HERE”></div> </div>     Now login to webid panel and disable captcha setting to now as below.   Now you open the home page in webid admin panel and click on clear cache as below Now open the registration page you will see the new Google recapcha version 2 as follows    

» Read more

Enable Right Click – Copy in protected web pages

Problem : Some websites use javascripts to block mouse right click so that you will not be able to copy text or images from the site. Solution: If you are using google chrome , add the extension called Allow Copy. Features of Allow Copy: Allow Copy will re-enable select, copy, paste and right click in any webpage using any copy protection. Just click on extension icon to enable it on any page!    

» Read more

WYSIWYG For Bootstrap ASP.Net MVC with Image Upload Feature

One of the common issue face is adding rich text editor with image upload option in bootstrap project which uses MVC , C# ASP.net I have spent a lot of time to customize TinyMCE editor, however I could not succeed completely. I have found summernote a very lite weight editor for Bootstrap. Step 1 : Create a default MVC ASP.NET project in Visual Studio 2013 Step 2 : Download summernote from http://summernote.org/ Step 3 : Copy the downloaded folder content to Scripts folder as shown Step 4 : Edit View –> Shared -> Layout.cshtml Move jquery bundle to top of the page Step 5: Create a Model , name as News.cs   using System.Web.Mvc; namespace WYSWYG.Models { public class News { public string Title { get; set; } [AllowHtml] public string Content { get; set; } } } Step6 Create a Controller NewsController.cs using System.Web.Mvc; using WYSWYG.Models; namespace WYSWYG.Controllers { public class NewsController : Controller { public ActionResult Index() { News newscontent = new News(); return View(); } [HttpPost] public ActionResult Index(News model) { return View(“NewsDisplay”, model); } } } Step 7 : Create a View and Name it as Index.cshtml under The View Folder News @model WYSWYG.Models.News @{ ViewBag.Title = […]

» Read more

XENSERVER – Free Open Source Virtualization Platform

XenServer is the leading open source virtualization platform, powered by the Xen Project hypervisor and the XAPI toolstack. It is used in the world’s largest clouds and enterprises. XENSERVER FEATURES XenServer is an enterprise-class, cloud-proven, virtualization platform that delivers all of the critical features needed for any server and datacenter virtualization implementation.  The following list summarizes some of the key capabilities of XenServer, and a complete technical FAQ can be found on the Citrix support web site. CORE PLATFORM XenServer is based on the Xen Project™ hypervisor.  The Xen Project hypervisor is a bare metal virtualization platform used by XenServer to deliver near native application performance for x86 workloads in an Intel and AMD environment. MANAGEMENT CAPABILITIES MULTI-SERVER MANAGEMENT XenCenter provides all the virtual machine management, monitoring and general administration, and general administration functions in a single interface. Administrators can easily manage hundreds of virtual machines from a centralized, highly available management console that installs on any Windows® desktop. The resilient distributed management architecture in XenServer distributes server management data across the servers in a resource pool to ensure that there is no single point of management failure. ROLE BASED ADMINISTRATION Role-based administration improves security and enables delegated access, control, and usage of XenServer […]

» Read more
1 2 3 33