{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/engineering/43","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"Gone are the days when learning coding or programming was reserved for the geeks or nerds. The case is exactly different nowadays. The…","fields":{"slug":"/engineering/learn-to-code-using-10-websites/"},"html":"<p>Gone are the days when learning coding or programming was reserved for the geeks or nerds. The case is exactly different nowadays. The latest buzz of “How to code” is here to stay. Making sure that you have little coding knowledge under your belt is proving to be an incredible skill no matter whether you are a marketer or an entrepreneur or a member of any of business team. Talk to any entrepreneur, marketer or freelancer, you will get an idea about learning coding will help you get through. The reasons are more than one! Half of the 2016 is gone, so if you haven’t included this incredible skill in your 2017’s new year resolution, you need to reconsider. Here is why!</p>\n<h3 id=\"why\" style=\"position:relative;\"><a href=\"#why\" aria-label=\"why permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Why?</strong></h3>\n<p>With softwares ruling the digital world, the demand of learning coding is becoming must for every professionals in every field whether it is marketing, technology, commerce, finance and what not. As the digital age is making us more and more dependant on computer softwares for business, learning to code has become helpful here. Learn to code is already in the must have technical skills list of 21st century and this demand of technical skills is growing like never before.</p>\n<p>Coding is problem solving. Coding is no different than the way you can fuel up your car, check the oil and get it serviced by reading the manual you are provided with. But coding takes you a long way ahead. It is beyond these simple things. It teaches you to repaint your car, customize the engine to make it work in the way you want. Hope you got an idea why coding is important and why you should also learn it.</p>\n<h3 id=\"you-are-convinced-now-what\" style=\"position:relative;\"><a href=\"#you-are-convinced-now-what\" aria-label=\"you are convinced now what permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>You are convinced! Now what?</strong></h3>\n<ul>\n<li>Did you know Bill Gates, got into programming at a very early age? The reason being his prep school used to provide students access to GE Mainframe Computer.</li>\n<li>Similarly the owner of Facebook, Mark Zuckerberg, hired a private programming tutor to learn the same while growing up.</li>\n</ul>\n<p>Yeah, yeah, I know this coding thing is not the only factor behind their success (or should I say making them billionaire), but it didn’t hurt either.</p>\n<p>But unlike them, most of us were not gifted with this kind of exposure to the digital world and most of us are still naive to how the world of programming works. Many of the people around are still wondering how to write and combine the long string of code to create a beautiful website, app and more! And trust me you are not alone!</p>\n<p>But don’t worry because with so many information available online, you can also master the same. No need to spend a lot of money or put yourself in debt in coding learning, as these resources are definitely going to help you to get through this.</p>\n<h3 id=\"10-handful-resources-to-make-the-process-of-learning-coding-easier\" style=\"position:relative;\"><a href=\"#10-handful-resources-to-make-the-process-of-learning-coding-easier\" aria-label=\"10 handful resources to make the process of learning coding easier permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>10 handful resources to make the process of learning coding easier!</strong></h3>\n<h4 id=\"1codecademy-\" style=\"position:relative;\"><a href=\"#1codecademy-\" aria-label=\"1codecademy  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>1. <a href=\"https://www.codecademy.com/\">Codecademy</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> - Free but pro-version also available at $19.99/moPro for $19.99/moPro for $19.99/mo</p>\n<p>Codecademy - Teaching the world how to code, definitely tops my list while talking about the top resources for how to learn programming. Currently owning around 25 million users, one can start learning as soon as he registers himself on the website. They can learn to design websites with HTML, CSS and also customize it with Javascript.</p>\n<p>The courses provided are not lecture style but the students actually get to do hands on coding and witness changes real time. Sims, the owner of Codecademy says that the website allows students to learn the coding by providing preview for every line they write immediately instead of watching an instructor. Apart from that, Codecademy also provides students access to QnA forums and groups to learn on topics like Python, Ruby on Rails, Etsy, etc.</p>\n<p><strong>2. <a href=\"https://www.w3schools.com/\">W3schools</a></strong> <strong>:</strong></p>\n<p><strong>Price</strong> : Free</p>\n<p>W3schools - the largest web developer site, as they define it, provides free tutorials on JavaScript, HTML, CSS, jQuery and what not along with lot of references. So if you want to know what <div> means, it will quickly show up that “<div> defines a division or section in HTML document.”</p>\n<h4 id=\"3tuts-\" style=\"position:relative;\"><a href=\"#3tuts-\" aria-label=\"3tuts  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>3. <a href=\"https://tutsplus.com/\">Tuts+</a></strong> <strong>:</strong></h4>\n<h4 id=\"price--15mo-and-pro-version-at-360year\" style=\"position:relative;\"><a href=\"#price--15mo-and-pro-version-at-360year\" aria-label=\"price  15mo and pro version at 360year permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Price</strong> : $15/mo and pro version at $360/year</h4>\n<p>The website provides tiered subscription plan that allows users to download multiple ebooks too along with the course. The ebook comprises of a huge catalog that comes with different code specifics like Jekyll, Sass, SVG, etc. I should definitely not forget to mention that even professionals can take the ongoing education courses to brush up their programming skills. The website provides learner tutorials in the form of write-ups about various topics.</p>\n<p><strong>Price</strong> : Free but pro version available at $29/mo</p>\n<p>The famous e-learning course provider offers a wide range of courses in several types of programming languages, web tools and designing. The website offers both free as well as paid versions. With free version users can get access to the 10 introductory courses that include topics like SQL, Objective C, jQuery which are great for getting started. While with the paid version, users can get access to 200 videos and 50+ interesting courses. The website basically works on learn, practice, win and track model which means first the users can learn via watching videos and then challenges are placed in front of them to track their learning experience.</p>\n<h4 id=\"5khan-academy-\" style=\"position:relative;\"><a href=\"#5khan-academy-\" aria-label=\"5khan academy  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>5. <a href=\"https://www.khanacademy.org/\">Khan Academy</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Free</p>\n<p>The academy is best for those who prefer short videos to learn things. Started in 2006, by Salman Khan, the idea of this website was generated after creating and sharing video tutorials on Youtube. One of the original e-courses providers, the Khan Academy has become widely popular over the years and offers courses in numerous programming languages, both for beginners as well as experts. Relying heavily on videos, users can learn to code animations, games, drawings and a lot more. For those who are planning to start their coding career, or are beginners at coding, the Khan Academy is the best place.</p>\n<h4 id=\"6treehouse-\" style=\"position:relative;\"><a href=\"#6treehouse-\" aria-label=\"6treehouse  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>6. <a href=\"https://teamtreehouse.com/\">Treehouse</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Free trial for 2 weeks, Basic version at $25/mo and pro version at $50/mo</p>\n<p>The online technology courses provider, Treehouse provides programming courses for both beginners as well as experts. The website works on learn, practice and earn model. With 222+ courses, videos, challenges, the website makes sure that the learners are kept busy. Apart from that, it also helps you learn new business strategies to make the best out of your knowledge. But unlike above mentioned options, for this one, you need to spend some cash before you go ahead. The basic version comes at $25/mo with which you get access to around 1000+ videos and can take interesting challenges. While if you go for the pro version at around $50/mo users can unlock the bonus content and download videos to watch offline too.</p>\n<h4 id=\"7codeorg-\" style=\"position:relative;\"><a href=\"#7codeorg-\" aria-label=\"7codeorg  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>7. <a href=\"https://code.org/\">Code.org</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Free</p>\n<p>Another player in the field of online coding courses, the website’s mission is to provide more and more people opportunity to learn programming. The website works more like games with drag &#x26; drop tiles. Learners can see the code both during challenge as well as when it is completed.</p>\n<p>The next three in the list are massive open online courses provider ie MOOC. These websites provide courses related to not only coding but other fields too like life science, engineering, health habits, etc.</p>\n<h4 id=\"8coursera-\" style=\"position:relative;\"><a href=\"#8coursera-\" aria-label=\"8coursera  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>8. <a href=\"https://www.coursera.org/\">Coursera</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Both free and paid</p>\n<p>Despite of being founded just 4 years ago, Coursera has become a major Major Open Online Courses provider that offers around 1990 courses from 119 well known institutions. Though there are certain programs that require you to spend money to get certified, there are hundred of other free introductory courses that provide specializations from well known universities like University of Toronto and Vanderbilt, etc. One of the widely popular MOOCs provided by Coursera is “<a href=\"https://www.coursera.org/learn/python\">Programming for everybody (Getting started with Python)</a></p>\n<h4 id=\"9udemy-\" style=\"position:relative;\"><a href=\"#9udemy-\" aria-label=\"9udemy  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>9. <a href=\"https://www.udemy.com/\">Udemy</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Free to hundreds of dollars</p>\n<p>Another MOOC provider, Udemy is one place you can find resources for just anything. It is a great place to develop your coding skills with courses like <a href=\"https://www.udemy.com/java-the-complete-java-developer-course/\">Complete Java Developer Course</a>. Though the courses fee varies from free to hundreds of dollars, Udemy has created its own position when it comes to learning programming<strong>.</strong> Another feature that it brings along is to allow user to sign up as an instructor and create his/her own course.</p>\n<h4 id=\"10edx-\" style=\"position:relative;\"><a href=\"#10edx-\" aria-label=\"10edx  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>10. <a href=\"https://www.edx.org/\">edX</a></strong> <strong>:</strong></h4>\n<p><strong>Price</strong> : Free</p>\n<p>Similar to above, this one is also a MOOC provider, serving millions of students around the globe. But this one is a non profit and open source which means anyone can build his own tools and contribute to the edX platform. Some of the most popular edX course is “Fundamentals of Computer Science” by IIT Bombay. Most of the courses I found here were free, but to get a verified certificate you need to spend some cash which differs between the type of courses you are enrolled with.</p>\n<p>Though there are hundreds of other websites that help you to enhance your coding skills, these are the top ten sites I found to be the best. Have you tried any of these? How was your experience? I would love to know about it in the comments below.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 21, 2016","updated_date":null,"description":null,"title":"Learn How To Code Using The 10 Cool Websites","tags":["Courses","Learning Websites"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3605442176870748,"src":"/static/fe153e8c041087d5f2b13e90eb01dbb6/630fb/How-to-code-using-the-10-cool-websites-768x564-300x220.png","srcSet":"/static/fe153e8c041087d5f2b13e90eb01dbb6/69585/How-to-code-using-the-10-cool-websites-768x564-300x220.png 200w,\n/static/fe153e8c041087d5f2b13e90eb01dbb6/630fb/How-to-code-using-the-10-cool-websites-768x564-300x220.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"excerpt":"Many of the developers believe that they are immune to the need of marketing/branding themselves. As a developer your job is to create…","fields":{"slug":"/engineering/personal-branding-for-developers/"},"html":"<p>Many of the developers believe that they are immune to the need of marketing/branding themselves. As a developer your job is to create ultimate applications, right? After all you are not a celebrity or some rockstar! But isn’t it better to be in demand for fruitful consultations, speaking and writing? Well, all this is possible if you are able to create a personal brand!</p>\n<p>In this article I am going to focus on why as a developer you should focus on personal branding, how it is going to help your job and career and finally, will guide you on how you can also create a personal brand. First thing first, let’s start with what is personal branding.</p>\n<p><strong>What is personal branding?</strong></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 248px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 120.96774193548387%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFQElEQVQ4y5WVe2xTVRzH79beFiKLLGFIQswUFDWLG2rGDMIfoGAiEsIjMUgGAxIZiBAc/iORKCSKYEIgjoiAxCAYGLDxEojDUfZo1/Vx+7pr167v59ptbQfrtvae4+93aKfRBOMfv57T23M+9/v9/X7nlOM4Tv6kKCoqwlFWWVnJy+S8jFLKNZ74ftbV5ivPwXOuvLz8n3ueDERYRUUFD2MRzl0u575oNJIxmYw/IXz//i+m/C9gaWmpvKbmTTlu9njc55OpYRqLRehvt67X47NNG2uV/wWU8TwvnzXrGblSqZRv27ZNiRvFXnFTeiRNU8khKhj1nldenjcDN8+dO4f/F7CQp5kzZ8p37NihrKurYxbXrF0nP3Pm9BQEBgK+Lp/PTTvb76cOHvzy7cFElNu9exe/uW6Tcv78KlwvKy4ulnMF2IIFC/gXXnyJJR1jesnUEoTiHF/a0tx079TJxvMwfxafbd1ahwr5wvqVK1cokIOLZUuWLOHzG4vFXttH8fhARzKVdMcTcaOr33mkpflK1fSnS2ZfamqqiUTDR2KxqDmeGPCGw0HRJBiOHjjwVRnuX716lYKrqmJyuarKiqdg8Y3RzCjNjGUm49HoIzo8PJRJpVOukYcjFGNwME5DQR919onUatZTg07tunPn1qtMVH19PVMXCgV/GZ8YpwAcB0gOQsqP2bHxMYCP0WEoSDDom/C4nTlnn00SbULOatJN6LSd9Mrli9sZED80GvWyh48eIgwBBFXlR4KwVDophcOBXCjklyLhEA0GfNTd7yAOu0USDN305A+NnyBn58fbeQYMBAM/5u1N/B2WARj0HAn4PSSRGCBDQwkai0ZowO8l/S57ts9uoW337l5DxrXmJjm2G6sg5E7IA5nCQh4DAS/BSCaHmd14PEZAIfH7PAjMiVaBtv5+d8vjqm+ewqq8fPmyaQPxWBghmDccRzMZ6nY7pVDQT8AuFGWQQCHIQCwKxQgQr8dFIIfE0WuhDx6oViBwzZrVCtaCixcvmgZnM4Q5hJBQmcMh5vx+j5QeSVGwiVZJfCBGUR3YZfmz95olu2imOp32g8cKtygLfajw+bzWdDqFNiVRtGQddlsuDcpQFeSOgjJmFYvh9TgpqhOtxqwNWgbWn0Lgd0cOTWVHD7/02sWmUSiG02kf03S1jw8OsuQTLEg0EibhUJApQ5jLKRK7aML+I4JeTaF1sl3qrsXIWbdurYIBdfqePdFomN65fT3p8/YTyBO0hp8pworCM7DZR7CRCzCTsZsaejpzRl0XtVoMsba21qVolwHPnj0771rL5YhW05H1+/pZjqB5qcfdR2DOVGGL9NoEwmDQewAiACR6bUcWRmrUaxIbajeWcp/t/VSB0HM/nzmNb4dkQw4tFAIbF5NPEGSzGIhF6KEmg2YS9hjYmUXrcAvdZCdl0aK3GPDEicbX4C0TVrMOLUl4RlGNxaSjZkELoG7M2SToL2BHTtBr6MWLv76fv2A4+e5dO9klevNGy9dwNkFB57hg0IA1DQE1EgTayqE9Fj2dEsK0atUYVlrd1c5Oy96GPeyikZWVlcnfe3dpMbaQSvVHK1ik+GZdd3vODMlHSwZIvlGnpmajFi1TfXc7O3oWsxD4cMOGcgRWV1fzhb8AvGCZ9fLn58xQqdpu2+EU9DlsVKPuCDVfbTp17NjRnRcunDuout+qtlqELBbNYNAZGxoaKnHf+vXrJy/Yyb+AhQsXKvJ54L85dOidY8ePr3r9jerZ7FYmE1z+N8Xn+/bVfHv48HKYl+Cz2tpaBkPOn8XhnHEUR9K4AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Apple Logo\"\n        title=\"Apple Logo\"\n        src=\"/static/3b7e1dd5a9052777d27adfc627506dac/544ba/Apple-logo-248x300.png\"\n        srcset=\"/static/3b7e1dd5a9052777d27adfc627506dac/544ba/Apple-logo-248x300.png 248w\"\n        sizes=\"(max-width: 248px) 100vw, 248px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>Do you recognize this logo? Well, Of course  you do! But have you ever wondered how come you recognized this logo without even a name? Well, you recognized it because the brand is so strong that without even a proper title, you are able to recognize it and that’s what branding do.</p>\n<p>The concept of personal branding is quite similar to that of company branding. Personal branding is all about thinking yourself as a brand. It is about showing people who you are and what is your passion. When you think about some specific programming language, your mind goes back to some specific names associated with that language, who are either the father of that language or have done some amazing work in that field, right?</p>\n<p>To get the more clear idea, here is what <a href=\"http://www.paulirish.com/\">Paul Irish</a>, the front end developer of Google Chrome team, has to say on the concept of personal branding - </p>\n<p><em>“Personal branding is the art of consistently presenting, online and offline, the essence of how you stand out from the crowd.”</em></p>\n<p>Personal branding is all about you and only you :  </p>\n<ul>\n<li>who you are</li>\n<li>what are you passionate about</li>\n<li>who you wanna be</li>\n<li>how would you like to be seen</li>\n<li>how actually people see you</li>\n<li>what you do and what you did</li>\n<li>what you know and what you don’t</li>\n<li>what you like to share</li>\n</ul>\n<p>and more! Personal branding is basically about everything that defines you from the languages you are expertize to the blogs you write.</p>\n<p><strong>Why you should focus on personal branding?</strong></p>\n<p>Personal branding is no longer an option, but it has become crucial for everyone. After all we are living in the digital world where it is simpler to reach to the next level. So it’s not exactly about being the rockstar but maybe it is. May be it is about becoming popular! May be it is about getting that power. Here I am presenting you three key reasons why personal branding is important for you-</p>\n<ol>\n<li><strong>You are not crucial!</strong><br>\nC’mon, no matter how rude that sounds, but you know it is true. The competition is increasing day by day and you know, there are millions of others waiting out there to take your place. So yeah, face it, YOU ARE NOT CRUCIAL! and this gives you one of the key reason to try your hand in personal branding. Let people know what you do and why you are better than others..</li>\n<li>\n<p><strong>No job is permanent!</strong>  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Another harsh reality! No matter how much your company loves you but you know no job is forever. So be prepared! You don’t know when the situation changes. As a developer personal branding matters when you are looking to change your job. You want your employers to hire you not only as a good developer but also as an innovative leader. To make that possible, you need to cultivate a personal brand that can highlight your value to your potential employers.</span></code></pre>\n</li>\n<li>\n<p><strong>Sky's the limit!</strong>  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">The process of learning has no end. While creating personal brand, you meet many people from your niche. You interact with them, share your knowledge, learn from them, discuss ideas and all this will give you the level of expertise that wouldn’t have been possible otherwise. Doesn’t matter how you want to improve your career, personal branding is the key!</span></code></pre>\n</li>\n</ol>\n<p><strong>How to manage your personal brand?</strong></p>\n<p>As a developer, breaking through the glass ceiling demands much more than excellent programming skills. Cultivating a strong personal brand can really help you out. GET VISIBILITY is all I want to say!</p>\n<p>You might have the best expertise in certain technology, you might have designed an amazing product but all this is meaningless if nobody can see you. Here are some tips on how you can get visibility :</p>\n<ol>\n<li>\n<p><strong>Try your hand at blogging :</strong><br>\nBlogging is an amazing way to tell people who you are. Blog about anything you hold expertize in, whether it is a programming language or it is some kind of technology, let people understand who you actually are. There are many developers out there who have some awesome technical blogs where they share their knowledge and write about their specialities.For inspiration you can have a look at the blog of <a href=\"http://ejohn.org/\">John Resig</a>, the creator and founder of jQuery. Another tech blog champion is Scott Hanselman. Make sure to have a look on his popular blogs <a href=\"http://www.hanselman.com\">www.hanselman.com</a>, <a href=\"http://hanselminutes.com/\">hanselminutes</a>, etc.  </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 600px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 50%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAKABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAIDBAX/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAAB1FuIBIJ//8QAGBABAQEBAQAAAAAAAAAAAAAAAQACECH/2gAIAQEAAQUCYNw+Wef/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAVEQEBAAAAAAAAAAAAAAAAAAAQMf/aAAgBAgEBPwGH/8QAGRAAAgMBAAAAAAAAAAAAAAAAABEBAjEg/9oACAEBAAY/ApV5ZqNfH//EABsQAQACAgMAAAAAAAAAAAAAAAEAETFREEGB/9oACAEBAAE/IReI9CytVxuGAbtwAWjMx9eP/9oADAMBAAIAAwAAABBj3//EABYRAQEBAAAAAAAAAAAAAAAAAAEQEf/aAAgBAwEBPxBVdZ//xAAXEQEAAwAAAAAAAAAAAAAAAAABEBEh/9oACAECAQE/EDFEf//EABwQAQEAAgIDAAAAAAAAAAAAAAERACExYRBRgf/aAAgBAQABPxAwbmQN9/PWQ5Jrs3tXnI8w3HOKACqoc4R3Bng//9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blogging for personal branding\"\n        title=\"blogging for personal branding\"\n        src=\"/static/d7e80828aaefc1d4cea44b8afed583a4/b4294/blogging-for-personal-branding.jpg\"\n        srcset=\"/static/d7e80828aaefc1d4cea44b8afed583a4/b4294/blogging-for-personal-branding.jpg 600w\"\n        sizes=\"(max-width: 600px) 100vw, 600px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>Stick to one topic, you are best at and select the blogging platform that suits you like Wordpress, Tumblr, Blogspot, etc. Post informative content on regular basis and soon you will have a huge audience waiting for your content and engaging with you. Posting two to three informative blog is enough to keep you in demand. Also there are some specific sites like<a href=\"http://www.asp.net\">www.asp.net</a> where you can submit articles to gain immense popularity.</p>\n</li>\n<li>\n<p><strong>Embrace Social Media :</strong>  </p>\n<p>You might have heard that Facebook and Twitter are all about wasting time, but let me tell you this is not at all true. Social media provides you a great opportunity to build networks. It is must to get visibility on various social media networks if you want to be found by people who share same niche as you.<br>\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 444px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 78.82882882882883%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAQABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAEDAgX/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAAB6zwosUK//8QAGRAAAwEBAQAAAAAAAAAAAAAAAAECAxET/9oACAEBAAEFAr0kT6vSTaGzOameI//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABkQAQADAQEAAAAAAAAAAAAAAAABETEhMv/aAAgBAQAGPwL1SOtXDGP/xAAaEAADAQADAAAAAAAAAAAAAAABESEAMUGh/9oACAEBAAE/IYKC1YfuE4ACOK+kVc4JSG4KoPf/2gAMAwEAAgADAAAAEPwf/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAERIf/aAAgBAwEBPxCKUw//xAAWEQEBAQAAAAAAAAAAAAAAAAARARD/2gAIAQIBAT8Qa5//xAAbEAEBAAMAAwAAAAAAAAAAAAABEQAhQTFRkf/aAAgBAQABPxCSiqaTXvInRGkjh9KnY5IbGgivuQlHrzvFB129dz//2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"social media for personal branding\"\n        title=\"social media for personal branding\"\n        src=\"/static/4499769ef6d6181005eb31446fc64dcb/4e073/Social-media-for-personal-branding.jpg\"\n        srcset=\"/static/4499769ef6d6181005eb31446fc64dcb/4e073/Social-media-for-personal-branding.jpg 444w\"\n        sizes=\"(max-width: 444px) 100vw, 444px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span><br>\nThere are various ways how you can track your brand on social media. My personal favorite is Google Alert which notifies whenever people are talking about me or my projects. While some times they are talking about the work I have done, sometimes they also complaint which helps me understand where I am wrong. There are many others, like on Twitter, you can use <a href=\"https://tweetdeck.twitter.com/\">Tweetdeck</a> . Apart from that, create a strong persona on Linkedin, Facebook, Google+, etc. Interact with people, reply to their queries and become social media champion.<br>\nSome popular developers who are social media champions as well include <a href=\"https://twitter.com/shanselman\">Scott Hanselman</a>, <a href=\"https://www.linkedin.com/in/jeresig\">John Resig</a>, etc  </p>\n</li>\n<li>\n<p><strong>Participate in Communities:</strong>  </p>\n<p>Communities like Quora, Stackoverflow, Warrior Forum, etc can be your best friends if you are intending to create brand online. Join these communities and try your best to solve the queries of users from your niche. It will not only help you interact your kind of people but will also improve your problem solving skills. Sites like Stack Overflow, GitHub allow users to work together on projects, that can open a wide opportunity to learn.  </p>\n</li>\n<li>\n<p><strong>Contribute to Open source or start Open source :</strong>  </p>\n<p>Another great way to cultivate personal brand is to contribute to open source or start open source. While contributing to an open source can be an amazing experience it will earn you recognition among your fellow community. Also you can start open source. If you are getting difficulties to start open source, have a look at this interesting <a href=\"https://opensource.guide/how-to-contribute/\">article</a>.</p>\n</li>\n</ol>\n<p><strong>What I’m trying to say is</strong></p>\n<p>Maybe you don’t want to become a rockstar developer or you are happy with your current job, but still there is a huge difference between doing the job and doing the job in excellent way. After all, you have worked hard to be where you are today and you deserve to get recognized for it. So why tomorrow, start now and reach the next step.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"September 23, 2016","updated_date":null,"description":null,"title":"Personal Branding For Developers: Why and How?","tags":["Branding"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/ce6fe2aec02784b1878d1ea52335b1c6/aabdf/Personal-Branding-For-Developers-150x150.jpg","srcSet":"/static/ce6fe2aec02784b1878d1ea52335b1c6/aabdf/Personal-Branding-For-Developers-150x150.jpg 150w","sizes":"(max-width: 150px) 100vw, 150px"}}},"author":{"id":"Sreekant","github":null,"avatar":null}}}},{"node":{"excerpt":"I often come across people and clients who would like to build their custom login, registration, and lost password form in WordPress instead…","fields":{"slug":"/engineering/wordpress-custom-login-form-part-1/"},"html":"<p>I often come across people and clients who would like to build their custom login, registration, and lost password form in WordPress instead of using the default wp-login.php page. It's probably because it's too wordpress-y.</p>\n<p>In this tutorial, I will demonstrate how to build a custom login form using the default functionality that wordpress gives us.</p>\n<ul>\n<li><a href=\"#buildlogin\">Building a Custom Login Form</a></li>\n<li><a href=\"#loginresponse\">Handling the Login Form Response</a></li>\n</ul>\n<h2 id=\"building-a-wordpress-login-form-out-of-the-box\" style=\"position:relative;\"><a href=\"#building-a-wordpress-login-form-out-of-the-box\" aria-label=\"building a wordpress login form out of the box permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Building a WordPress Login Form (Out of the box)</h2>\n<p>This is what WordPress gives us out of the box.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 574px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 79.79094076655052%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAIAAACZeshMAAAACXBIWXMAAAsTAAALEwEAmpwYAAABSUlEQVQoz42TsU7DMBCG+568QDfExM6MxMLEysTAwAOAhACpEogBVQUxhgoS3DRnOznHTuLyJyVQVU3aXydHOfvz+c7ngewWa2VS3bNgsNFLDXl6O9m/fPwUc61qz05wQoSA4yAcXoz2zh/O7t5spuHcCSaiVMmPKD65GR9ePV1PAuy1E6yUhpRSnOmY5FTM8yyF90+bYQRkZu99URRlWfpaC8hX3rc/mOqEjTEy5ShOYtLGldyY+bfKuV44xnlzZ2zBuVs1kzvJ8DvVDTOmpc4yY21ZrZkr/ZbIzloUxTAj7ao1yDWF6MsZBata1YArlgYQhYNtgbESIyOBZfCmyO+JORhNj18iMna129bhhUdiv8L1VM1tvSZmeB8cPX8lbNM+uFedx17dZfk2qG1JfATJGfW2J7pPCBGGoZiJ6LtWFIUYiTY+KvkDJA6JMgMgcv4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"wp-login\"\n        title=\"wp-login\"\n        src=\"/static/65a844891c904aa48a40be38b7735f76/86389/wp-login.png\"\n        srcset=\"/static/65a844891c904aa48a40be38b7735f76/86389/wp-login.png 574w\"\n        sizes=\"(max-width: 574px) 100vw, 574px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span><br>\nThere are quite a few different options available to make a custom login page. You can build a <a href=\"https://codex.wordpress.org/Shortcode_API\">shortcode</a> so that you could simply put [wp-login] or something you like on any page/post, make a page theme file and use that page to attach to a post/page, a widget could be a good solution too, or maybe you'd like to simply edit the existing form and add some pizzazz to it.</p>\n<p>I am going to show you all of this tutorial using the page-theme method because it is probably the easiest to implement for beginners. This will also give you an intro into page themes, if your not familiar with it.</p>\n<p>To start our theme, you will need to do the following:</p>\n<ol>\n<li>Install WordPress</li>\n<li>Navigate to your <em>wp-content/themes</em> folder and choose a theme to edit or install a new one</li>\n<li>create a file called <em>page-login.php</em> in the theme directory</li>\n<li>Next open that file with a text editor of your choosing and add the following at the top of the php file.</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/*</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">Template Name: Login</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">get_header</span><span class=\"mtk1\">(); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;div id=</span><span class=\"mtk8\">&quot;primary&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;content-area&quot;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;div id=</span><span class=\"mtk8\">&quot;content&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;site-content&quot;</span><span class=\"mtk1\"> role=</span><span class=\"mtk8\">&quot;main&quot;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;/div</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;!-- </span><span class=\"mtk3\">#content --&amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;/div</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;!-- </span><span class=\"mtk3\">#primary --&amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php </span><span class=\"mtk11\">get_sidebar</span><span class=\"mtk1\">(); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php </span><span class=\"mtk11\">get_footer</span><span class=\"mtk1\">(); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span></code></pre>\n<p>To initialize this page template, make sure to activate the theme you've selected in \"Appearance/Themes\" in your admin dashboard and then navigate to a page or post. On the right hand side of your page/post editor you should now see a dropdown available for template under \"Page Attributes\". Change your template to \"Login\" or to the name that you specified in \"Template Name:\" and that will attach that page theme to this page/post.</p>\n<p>Now we're ready to start editing this page-login.php template file. So first open this file in your favorite editor and Let's get a login page started.</p>\n<p>To quickly show you how to get this login on the page Let's paste the following code between the div with id of content.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;div id=</span><span class=\"mtk8\">&quot;primary&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;content-area&quot;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;div id=</span><span class=\"mtk8\">&quot;content&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;site-content&quot;</span><span class=\"mtk1\"> role=</span><span class=\"mtk8\">&quot;main&quot;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php </span><span class=\"mtk11\">wp_login_form</span><span class=\"mtk1\">(); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;/div</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;!-- </span><span class=\"mtk3\">#content --&amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;/div</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;!-- </span><span class=\"mtk3\">#primary --&amp;amp;amp;gt;</span></span></code></pre>\n<p>Look at what that small piece of code do</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 620px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 47.096774193548384%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAZElEQVQoz8XRTQuAIAwGYP//H9WDuA+WCTlrF6lDZOSh9zAEeZibznuvqvunuBCCYVkEENac7Vx7RMTqALfWmDmlVEq5Yia2qzEmIns/WBC33u1ZnhgRYoxvwM3MUwv7A8/88wGsLxStC5PBOgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"custom-login\"\n        title=\"custom-login\"\n        src=\"/static/48eca8e7849771947eb5cf7f664a0d27/2a195/custom-login.png\"\n        srcset=\"/static/48eca8e7849771947eb5cf7f664a0d27/2a195/custom-login.png 620w\"\n        sizes=\"(max-width: 620px) 100vw, 620px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Now we need to set some arguments that we can provide to this form to customize it. Let's take a look at the documentation for <a href=\"https://developer.wordpress.org/reference/functions/wp_login_form/\">wp<em>login</em>form()</a></p>\n<p>In that document, it explains all the uses and arguments of wp<em>login</em>form(). Let's use those arguments section and see what happens. Paste the $args section shown in the wordpress doc right above our login form.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php </span><span class=\"mtk12\">$args</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">array</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;echo&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;redirect&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; ( </span><span class=\"mtk11\">is_ssl</span><span class=\"mtk1\">() ? </span><span class=\"mtk8\">&#39;https://&#39;</span><span class=\"mtk1\"> : </span><span class=\"mtk8\">&#39;http://&#39;</span><span class=\"mtk1\"> ) . </span><span class=\"mtk12\">$_SERVER</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;HTTP_HOST&#39;</span><span class=\"mtk1\">] . </span><span class=\"mtk12\">$_SERVER</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;REQUEST_URI&#39;</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;form_id&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;loginform&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;label_username&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk11\">__</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;Username&#39;</span><span class=\"mtk1\"> ),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;label_password&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk11\">__</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;Password&#39;</span><span class=\"mtk1\"> ),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;label_remember&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk11\">__</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;Remember Me&#39;</span><span class=\"mtk1\"> ),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;label_log_in&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk11\">__</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;Log In&#39;</span><span class=\"mtk1\"> ),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;id_username&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;user_login&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;id_password&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;user_pass&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;id_remember&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;rememberme&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;id_submit&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;wp-submit&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;remember&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;value_username&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk8\">&#39;&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">&#39;value_remember&#39;</span><span class=\"mtk1\"> =</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt; </span><span class=\"mtk4\">false</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;lt;?php </span><span class=\"mtk11\">wp_login_form</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$args</span><span class=\"mtk1\"> ); ?</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span></span></code></pre>\n<p>It will look the same as the one we did earlier but, by customizing the arguments above, you can customize elements of the login form.</p>\n<h2 id=\"handling-the-login-form-response-custom\" style=\"position:relative;\"><a href=\"#handling-the-login-form-response-custom\" aria-label=\"handling the login form response custom permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Handling the login form response (Custom)</h2>\n<p>To handle the Login Form response we need to grab the $_POST parameters and login the user. You can create this as complex as you like, but I will demonstrate a simpler but effective method.</p>\n<p>For this action, we'll be using the <strong>after<em>setup</em>theme</strong> and <strong>wp_authenticate</strong>. I have added the following two functions within the functions.php file. The first function <strong>optional<em>email</em>address_login</strong> searches for a users email address based on their username, with this functionality you can log in using your email address or the username.</p>\n<p>The second function, <strong>login_user</strong>, handles the actual functionality of the login by receiving the $<em>POST parameters and passing them into the wp</em>signon method.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">/**</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">* optional_email_address_login allows the user</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">* to log in with a email address as well as a username</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">* </span><span class=\"mtk4\">@param</span><span class=\"mtk3\"> </span><span class=\"mtk4\">string</span><span class=\"mtk3\"> &amp;amp;amp;amp;$username username or email</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">* </span><span class=\"mtk4\">@param</span><span class=\"mtk3\"> </span><span class=\"mtk4\">string</span><span class=\"mtk3\"> &amp;amp;amp;amp;$password password</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">optional_email_address_login</span><span class=\"mtk1\">( &amp;amp;amp;amp;</span><span class=\"mtk12\">$username</span><span class=\"mtk1\">, &amp;amp;amp;amp;</span><span class=\"mtk12\">$password</span><span class=\"mtk1\"> ) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$user</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">get_user_by</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;email&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">$username</span><span class=\"mtk1\"> );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> ( ! </span><span class=\"mtk11\">empty</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$user</span><span class=\"mtk1\">-</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;user_login ) )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$username</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">$user</span><span class=\"mtk1\">-</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;user_login;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Allows the use of email logins</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">add_action</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;wp_authenticate&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&#39;optional_email_address_login&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\"> );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/**</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">* login_user handles the $_POST array and logs in users</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">login_user</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> ( ! </span><span class=\"mtk11\">is_user_logged_in</span><span class=\"mtk1\">() ) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$creds</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">array</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$creds</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;user_login&#39;</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">isset</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;log&#39;</span><span class=\"mtk1\">] ) ? </span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;log&#39;</span><span class=\"mtk1\">] : </span><span class=\"mtk8\">&#39;&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$creds</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;user_password&#39;</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">isset</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;pwd&#39;</span><span class=\"mtk1\">] ) ? </span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;pwd&#39;</span><span class=\"mtk1\">] : </span><span class=\"mtk8\">&#39;&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$creds</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;remember&#39;</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">isset</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;rememberme&#39;</span><span class=\"mtk1\">] ) ? </span><span class=\"mtk4\">true</span><span class=\"mtk1\"> : </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$user</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">wp_signon</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$creds</span><span class=\"mtk1\">, </span><span class=\"mtk4\">false</span><span class=\"mtk1\"> );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> ( </span><span class=\"mtk11\">is_wp_error</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$user</span><span class=\"mtk1\"> ) ) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">error_log</span><span class=\"mtk1\">( </span><span class=\"mtk12\">$user</span><span class=\"mtk1\">-</span><span class=\"mtk4\">&</span><span class=\"mtk1\">amp;amp;amp;gt;</span><span class=\"mtk11\">get_error_message</span><span class=\"mtk1\">() );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Run login_user before headers and cookies are sent</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">add_action</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&#39;after_setup_theme&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&#39;login_user&#39;</span><span class=\"mtk1\"> );</span></span></code></pre>\n<p>In this example I have used the default WordPress login form that you could customize and style to your desire. In the next blog, I will be demonstrating how to build a login form that is fully customized. We won’t be using the provided wordpress functions!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"March 01, 2016","updated_date":null,"description":null,"title":"Wordpress Custom Login Form Part 1","tags":["WordPress","Learning"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/400bee4b6d2f5f571912dff23f863421/6d161/wordpress-icon-150x1501-150x150.png","srcSet":"/static/400bee4b6d2f5f571912dff23f863421/6d161/wordpress-icon-150x1501-150x150.png 150w","sizes":"(max-width: 150px) 100vw, 150px"}}},"author":{"id":"Zoie Carnegie","github":null,"avatar":null}}}},{"node":{"excerpt":"1. Secure your server Many known attacks are possible only once physically accessing a machine. For this reason, it is best to have the…","fields":{"slug":"/engineering/is-your-database-secured-think-again/"},"html":"<p><strong>1. Secure your server</strong></p>\n<p>Many known attacks are possible only once physically accessing a machine. For this reason, it is best to have the application server and the database server on different machines. If this is not possible, greater care must be taken, Otherwise, by executing remote commands via an application server, an attacker may be able to harm your database even without permissions. For this reason, any service running on the same machine as the database should be granted the lowest possible permission that still allows the service to operate.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 494px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 38.8663967611336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAIAAAB2/0i6AAAACXBIWXMAAAsTAAALEwEAmpwYAAABPUlEQVQY031Q2U7DQAzc//8GfgOEBELiGXGofQlpQumRZnNtstnLewaXvlEJa2RZs56x12S5Chdi0chdr8pGHpnediqnIqdyP+h6grJV+MSNx07SzxrxR29cQFgf0ciHBC4acGCddw7AGrDBoziRshHbTi7/hzVnODhnD0vAQicjSXYc8mqYpEGnGBNm4/xq1z+uq009+YBcWqyiHJ6z5v2bHXrR4tJxSXIk+YHme9qOAru8DzjmqxW3b/v7VbUqjlxCQrHXn/V885TdvW4f1tVHcaJMLnomBeUlnZX1lwUVhAPTGyrwNsdB9sK6kBanqwleyj47TWVvdoNupU1yIsJ4CeeB6Vc8KXcaTcMNyjph2xkAVwQ1s5H1DDEzNnQDH3lSnFxfh2vHpEWgEd78QuIPI6NpaiOrEUkwJH8ANN/IbQHv70QAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"server-network-structure\"\n        title=\"server-network-structure\"\n        src=\"/static/db8fbab272d550b5b8073c8972f51a65/d72d4/server-network-structure.png\"\n        srcset=\"/static/db8fbab272d550b5b8073c8972f51a65/d72d4/server-network-structure.png 494w\"\n        sizes=\"(max-width: 494px) 100vw, 494px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span><br>\nDo not forget to install the whole security package: Antivirus and Anti-spam, Firewall, and all of the security packages recommended by your operating system's vendor. Also, do not forget to spend 10 minutes thinking of your server's physical location - in the wrong location, your server can be stolen, flooded, harmed by wild animals or vagrants.</p>\n<p><strong>2. Localhost Security or Disable or restrict remote access</strong></p>\n<p>Consider whether MySQL will be retrieved from the system or directly accessed from its own server. On the off chance that remote access is utilized, guarantee that just characterized hosts can get to the server. This is commonly done through TCP wrappers, IP tables, or some other firewall programming or hardware accessibility tools.<br>\nTo confine MySQL from opening a network socket, the accompanying parameter ought to be included in the [mysqld] area of my.cnf or my.ini:</p>\n<p>skip-networking</p>\n<p>The document is situated in the <em>\"C:\\Program Files\\MySQL\\MySQL Server 5.1\"</em> catalog on the Windows operating system or <em>\"/etc/my.cnf\"</em> or <em>\"/etc/mysql/my.cnf\"</em> on Linux.<br>\nThis line cripples the start of systems administration in the middle of MySQL startup. It would be ideal if you bear in mind that a local connection can be used set up a connection to the MySQL server.</p>\n<p>Another possible solution is to force MySQL to listen only to the localhost by adding the following line in the <em>[mysqld]</em> section of <em>my.cnf</em>bind-address=127.0.0.1<br>\nYou may not be willing to incapacitate system access to your database server if clients in your organization interface with the server from their machines or the web server introduced on an alternate machine. In that case, the following restrictive grant syntax should be considered:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; GRANT SELECT, INSERT ON mydb.\\* TO &#39;someuser&#39;@&#39;somehost&#39;;  </span></code></pre>\n<p><strong>3. Disable the use of LOCAL INFILE</strong></p>\n<p>The next change is to disable the use of the <em>\"LOAD DATA LOCAL INFILE\"</em> command, which will help to keep unapproved perusing from neighborhood records. This is particularly vital when new SQL Injection vulnerabilities in PHP applications are found.<br>\nIn addition, in certain cases, the <em>\"LOCAL INFILE\"</em> command can be used to gain access to other files on the operating system, for instance <em>\"/etc/passwd\"</em>, using the following command:  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; LOAD DATA LOCAL INFILE &#39;/etc/passwd&#39; INTO TABLE table1</span></code></pre>\n<p>Or even significantly less difficult:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; SELECT load\\_file(&quot;/etc/passwd&quot;)</span></code></pre>\n<p>To disable the usage of the <em>\"LOCAL INFILE\"</em> command, the following parameter should be added in the <em>[mysqld]</em> section of the MySQL configuration file.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">set-variable=local-infile=0</span></code></pre>\n<p><strong>4. Change root username and password, keep them strong.</strong></p>\n<p>The default administrator username on the MySQL server is <strong>\"root\"</strong>. Hackers often attempt to gain access to its permissions. To make this task harder, rename <strong>\"root\"</strong> to something else and provide it with a long, complex alphanumeric password.</p>\n<p>To rename the administrator’s username, use the rename command in the MySQL console:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; RENAME USER root TO new\\_user;</span></code></pre>\n<p>The MySQL <em>\"RENAME USER\"</em> command first appeared in MySQL version 5.0.2. If you use an older version of MySQL, you can use other commands to rename a user:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; use mysql;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">mysql&gt; update user set user=&quot;new\\_user&quot; where user=&quot;root&quot;;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">mysql&gt; flush privileges;</span></code></pre>\n<p>To change a user’s password, use the following command-line command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; SET PASSWORD FOR &#39;username&#39;@&#39;%hostname&#39; = PASSWORD(&#39;newpass&#39;);</span></code></pre>\n<p>It is also possible to change the password using the <em>\"mysqladmin\"</em> utility:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">shell&gt; mysqladmin -u username -p password newpass</span></code></pre>\n<p><strong>5. Remove the \"Test\" database</strong></p>\n<p>MySQL comes with a \"test\" database intended as a test space. It can be accessed by the anonymous user, and is therefore used by numerous attacks.<br>\nTo remove this database, use the drop command as follows:  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; drop database test;  </span></code></pre>\n<p>Or use the <em>\"mysqladmin\"</em> command:  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">shell&gt; mysqladmin -u username -p drop test  </span></code></pre>\n<p><strong>6. Remove Anonymous and outdated accounts</strong></p>\n<p>The MySQL database comes with some anonymous users with blank passwords. As a result, anyone can connect to the database to check whether this is the case, do the following:  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; select \\* from mysql.user where user=&quot;&quot;;  </span></code></pre>\n<p>In a secure system, no lines should be echoed back. Another way to do the same:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; SHOW GRANTS FOR &#39;&#39;@&#39;localhost&#39;;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">mysql&gt; SHOW GRANTS FOR &#39;&#39;@&#39;myhost&#39;;</span></code></pre>\n<p>If the grants exist, then anybody can access the database and at least use the default database<em>\"test\"</em>. Check this with:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">shell&gt; mysql -u blablabla</span></code></pre>\n<p>To remove the account, execute the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; DROP USER &quot;&quot;;</span></code></pre>\n<p>The MySQL <em>\"DROP USER\"</em> command is supported starting with MySQL version 5.0. If you use an older version of MySQL, you can remove the account as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; use mysql;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">mysql&gt; DELETE FROM user WHERE user=&quot;&quot;;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">mysql&gt; flush privileges;  </span></code></pre>\n<p><strong>7. Increase security with Role Based Access Control</strong></p>\n<p>A very common database security recommendation is to lower the permissions given to various parties. MySQL is no different. Typically, when developers work, they use the system's maximum permission and give less consideration to permission principles than we might expect. This practice can expose the database to significant risk.<br>\n* Any new MySQL 5.x installation already installed using the correct security measures.<br>\nTo protect your database, make sure that the file directory in which the MySQL database is actually stored is owned by the user \"mysql\" and the group \"mysql\".</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">shell&gt;ls -l /var/lib/mysql</span></code></pre>\n<p>In addition, ensure that only the user \"mysql\" and \"root\" have access to the directory <code>/var/lib/mysql</code>.<br>\nThe mysql binaries, which reside under the /usr/bin/ directory, should be owned by \"root\" or the specific system \"mysql\" user. Other users should not have write access to these files.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"16\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">shell&gt;ls -l /usr/bin/my\\*  </span></code></pre>\n<p><strong>8. Keep a check on database privileges</strong></p>\n<p>Operating system permissions were fixed in the preceding section. Now let’s talk about database permissions. In most cases, there is an administrator user (the renamed \"root\") and one or more actual users who coexist in the database. Usually, the \"root\" has nothing to do with the data in the database; instead, it is used to maintain the server and its tables, to give and revoke permissions, etc.<br>\nOn the other hand, some user ids are used to access the data, such as the user id assigned to the web server to execute \"select\\update\\insert\\delete\" queries and to execute stored procedures. In most cases, no other users are necessary; however, only you, as a system administrator can really know your application’s needs.</p>\n<p>Only administrator accounts needs to be granted the SUPER / PROCESS /FILE privileges and access to the mysql database. Usually, it is a good idea to lower the administrator’s permissions for accessing the data.</p>\n<p>Review the privileges of the rest of the users and ensure that these are set appropriately. This can be done using the following steps.  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"17\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; use mysql;  </span></code></pre>\n<p>[Identify users]  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"18\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; select \\* from users;  </span></code></pre>\n<p>[List grants of all users]  </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"19\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mysql&gt; show grants for ‘root’@’localhost’;</span></code></pre>\n<p>The above statement has to be executed for each user ! Note that only users who really need root privileges should be granted them.</p>\n<p>Another interesting privilege is \"SHOW DATABASES\". By default, the command can be used by everyone having access to the MySQL prompt. They can use it to gather information (e.g., getting database names) before attacking the database by, for instance, stealing the data. To prevent this, it is recommended that you follow the procedures described below.</p>\n<ul>\n<li>Add \" --skip-show-database\" to the startup script of MySQL or add it to the MySQL configuration file</li>\n<li>Grant the SHOW DATABASES privilege only to the users you want to use this command</li>\n</ul>\n<p>To disable the usage of the \"SHOW DATABASES\" command, the following parameter should be added in the [mysqld] section of the <code>/etc/my.cnf</code>:</p>\n<p>[mysqld]</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"20\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">skip-show-database  </span></code></pre>\n<p><strong>9. Enable Logging</strong></p>\n<p>If your database server does not execute many queries, it is recommended that you enable transaction logging, by adding the following line to [mysqld] section of the <code>/etc/my.cnf</code> file:</p>\n<p>[mysqld]</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"21\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">log =/var/log/mylogfile  </span></code></pre>\n<p>This is not recommended for heavy production MySQL servers because it causes high overhead on the server.<br>\nIn addition, verify that only the \"root\" and \"mysql\" ids have access to these logfiles (at least write access).</p>\n<p><strong>Error log</strong>Ensure only \"root\" and \"mysql\" have access to the log file \"hostname.err\". The file is stored in the mysql data directory. This file contains very sensitive information such as passwords, addresses, table names, stored procedure names and code parts. It can be used for information gathering, and in some cases, can provide the attacker with the information needed to exploit the database, the machine on which the database is installed, or the data inside it.</p>\n<p><strong>MySQL log</strong>Ensure only \"root\" and \"mysql\" have access to the logfile \"logfile XY\". The file is stored in the mysql data directory.</p>\n<p><strong>10. Change the root directory</strong> </p>\n<p>A chroot on UNIX {operating system} operating systems is an operation that changes the apparent disk root directory for the present running method and its children. A program that's re-rooted to a different directory cannot access or name files outside that directory, and therefore the directory is named a \"chroot jail\" or (less commonly) a \"chroot prison\".</p>\n<p>By using the chroot environment, the write access of the mySQL processes (and child processes) can be limited, increasing the security of the server.</p>\n<p>Ensure that a dedicated directory exists for the chrooted environment. This should be something like: <code>/chroot/mysql</code> In addition, to make the use of the database administrative tools convenient, the following parameter should be changed in the [client] section of MySQL configuration file:</p>\n<p>[client]</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"22\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">socket = /chroot/mysql/tmp/mysql.sock</span></code></pre>\n<p>Thanks to that line of code, there will be no need to supply the mysql, mysqladmin, mysqldump etc. commands with the <code>--socket=/chroot/mysql/tmp/mysql.sock</code> parameter every time these tools are run.</p>\n<p><strong>11. Delete old logs regularly</strong></p>\n<p>During the installation procedures, there's plenty of sensitive data which will assist unwelcome users to assault a database. This data is kept within the server’s history and might be terribly useful if one thing goes wrong during the installation. By analyzing the history files, administrators can figure out what has gone wrong and probably fix things up. However, these files are not needed after installation is complete.<br>\nWe should remove the content of the MySQL history file (~/.mysql_history), wherever all dead SQL commands are kept (especially passwords, that are kept as plain text):</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"23\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">cat /dev/null &gt; ~/.mysql\\_history</span></code></pre>\n<p>In conclusion,we should emphasize on database security. However it should be the first thing for any individual or a company.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"February 23, 2016","updated_date":null,"description":null,"title":"Is Your Database Secured? Think Again","tags":["Database","Security"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/6a50b3ff2cea92449f2f6ab9856c8a0a/630fb/database_secure-300x300.png","srcSet":"/static/6a50b3ff2cea92449f2f6ab9856c8a0a/69585/database_secure-300x300.png 200w,\n/static/6a50b3ff2cea92449f2f6ab9856c8a0a/630fb/database_secure-300x300.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Kunal","github":"SuperKunal","avatar":null}}}},{"node":{"excerpt":"Manipulating collections like arrays and objects can be a hassle with vanilla JS. Thankfully there are libraries like Underscore which offer…","fields":{"slug":"/engineering/be-more-manipulative-with-underscore-js/"},"html":"<p>Manipulating collections like arrays and objects can be a hassle with vanilla JS. Thankfully there are libraries like Underscore which offer some extremely useful low level utility functions.</p>\n<p>Underscore JS provides much of the array/collection/object manipulating functionality similar to what you may have seen in other languages such as Ruby. As for calling the methods if you're familiar with JQuery, Underscore is identical except instead of \"$\" we use the library's namesake \"_\" to access the methods.</p>\n<p>Underscore has over 100 functions that can be used on collections, arrays, objects and functions (you read that right, function functions). I'm going to be discussing a few of the functions that work on collections, but definitely check out what else <a href=\"http://underscorejs.org/\">Underscore has to offer</a>.</p>\n<p>Once you know how to re-create the same output with Underscore syntax, you'll never want to go back to plain old JS and using nested for loops. One of the most helpful tools Underscore provides for accomplishing this is...</p>\n<h2 id=\"_each\" style=\"position:relative;\"><a href=\"#_each\" aria-label=\"_each permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>_.each</h2>\n<p>The _each method does exactly what it sounds like. It works on collections (arrays or objects), and will iterate over each element in the collection invoking the function you specified with 3 arguments (value, index, list) with index being replaced by key if used on an object. It's also worth noting _.each returns the list if you want chain some more manipulation after calling _.each.</p>\n<p>Here's a quick example showing how it can be used and what's available to you when you call it.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">someArray</span><span class=\"mtk1\"> = [</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;b&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;c&quot;</span><span class=\"mtk1\">];</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">_</span><span class=\"mtk1\">.</span><span class=\"mtk11\">each</span><span class=\"mtk1\">(</span><span class=\"mtk12\">someArray</span><span class=\"mtk1\">, </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">element</span><span class=\"mtk1\">, </span><span class=\"mtk12\">index</span><span class=\"mtk1\">, </span><span class=\"mtk12\">list</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;value: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">element</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&quot; index: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">index</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&quot; list: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">list</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// outputs</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">value: </span><span class=\"mtk12\">a</span><span class=\"mtk1\"> index: </span><span class=\"mtk7\">0</span><span class=\"mtk1\"> list: </span><span class=\"mtk12\">a</span><span class=\"mtk1\">,</span><span class=\"mtk12\">b</span><span class=\"mtk1\">,</span><span class=\"mtk12\">c</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">value: </span><span class=\"mtk12\">b</span><span class=\"mtk1\"> index: </span><span class=\"mtk7\">1</span><span class=\"mtk1\"> list: </span><span class=\"mtk12\">a</span><span class=\"mtk1\">,</span><span class=\"mtk12\">b</span><span class=\"mtk1\">,</span><span class=\"mtk12\">c</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">value: </span><span class=\"mtk12\">c</span><span class=\"mtk1\"> index: </span><span class=\"mtk7\">2</span><span class=\"mtk1\"> list: </span><span class=\"mtk12\">a</span><span class=\"mtk1\">,</span><span class=\"mtk12\">b</span><span class=\"mtk1\">,</span><span class=\"mtk12\">c</span></span></code></pre>\n<p>With that out of the way, let's think about what this means in terms of cleaning up our code. To do the above normally we would write a little for loop like this.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">for</span><span class=\"mtk1\"> ( </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">0</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> &</span><span class=\"mtk12\">lt</span><span class=\"mtk1\">; </span><span class=\"mtk12\">someArray</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\">++) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;value: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">someArray</span><span class=\"mtk1\">[</span><span class=\"mtk12\">i</span><span class=\"mtk1\">] + </span><span class=\"mtk8\">&quot; index: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&quot; list: &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk12\">someArray</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Admittedly these two aren't all that different, but let's imagine we have a function defined elsewhere that will deal with handling the arguments passed in on each iteration. We can replace that same functionality with a significantly less verbose solution.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">_</span><span class=\"mtk1\">.</span><span class=\"mtk11\">each</span><span class=\"mtk1\">(</span><span class=\"mtk12\">someArray</span><span class=\"mtk1\">, </span><span class=\"mtk12\">doStuff</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>To quote Antoine de Saint Exupéry: \"It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove.\" While it may not be perfection, there are certainly arguments to be made about performance, I think you would be hard pressed to find anything further simplify this code.</p>\n<h2 id=\"_map\" style=\"position:relative;\"><a href=\"#_map\" aria-label=\"_map permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>_.map</h2>\n<p>While _.each will return the original list you input, _.map will allow you to manipulate or otherwise transform the input as you please and then returns the new array. Map needs a minimum of 2 arguments, first the collection and then the function to be executed on each iteratee and also accepts a third argument which dictates the context for the iterating function.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">numbersObject</span><span class=\"mtk1\"> = {</span><span class=\"mtk7\">1</span><span class=\"mtk12\">:</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk12\">:</span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk12\">:</span><span class=\"mtk7\">9</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">productArray</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">_</span><span class=\"mtk1\">.</span><span class=\"mtk11\">map</span><span class=\"mtk1\">(</span><span class=\"mtk12\">numbersObject</span><span class=\"mtk1\">, </span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">value</span><span class=\"mtk1\">, </span><span class=\"mtk12\">key</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\"> * </span><span class=\"mtk12\">key</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//proudctArray is now</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">[</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">8</span><span class=\"mtk1\">, </span><span class=\"mtk7\">27</span><span class=\"mtk1\">]</span></span></code></pre>\n<p>Before you go writing some functions to pass as an argument to _.map be sure to take a peek at the other methods available in Underscore. Map is a little bit like having the Lego blocks to build whatever you want, but if you already have a pre-packaged Batcave available, it might not be the best use of your time building it from scratch.</p>\n<h2 id=\"_pluck\" style=\"position:relative;\"><a href=\"#_pluck\" aria-label=\"_pluck permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>_.pluck</h2>\n<p>To illustrate my childhood toy analogy let's talk about _.pluck. Pluck is basically just a refined version of _.map made for a specific use case. That's not to say there aren't ways of combining the two to achieve something a little more complex, but if standard _.pluck behaviour is all you're after then don't go re-inventing the wheel.</p>\n<p>Often with data objects we're interested in the values of a specific key, for example let's say we have an array of movies.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">movies</span><span class=\"mtk1\"> = [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">title:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Dracula&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">genre:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Horror&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">star:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Nosferatu&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">title:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Cast Away&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">genre:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Drama&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">star:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Wilson&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">title:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Airplane&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">genre:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Comedy&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">star:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Leslie Nielsen&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">];</span></span></code></pre>\n<p>Now we want to just have an array of the titles of these movies.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">titlesArray</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">_</span><span class=\"mtk1\">.</span><span class=\"mtk11\">pluck</span><span class=\"mtk1\">(</span><span class=\"mtk12\">movies</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&#39;title&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//titlesArray is now</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">[</span><span class=\"mtk8\">&quot;Dracula&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;Cast Away&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;Airplane&quot;</span><span class=\"mtk1\">]</span></span></code></pre>\n<p>Not much else to say about it, it works on collections and is extremely handy for a very common task.</p>\n<h2 id=\"_filter\" style=\"position:relative;\"><a href=\"#_filter\" aria-label=\"_filter permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>_.filter</h2>\n<p>Another example of a more refined _.map function that comes in handy often enough. Aptly named this method will return an array of only the things that make it through your test.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">numbers</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">,</span><span class=\"mtk7\">33</span><span class=\"mtk1\">,</span><span class=\"mtk7\">6</span><span class=\"mtk1\">,</span><span class=\"mtk7\">24</span><span class=\"mtk1\">,</span><span class=\"mtk7\">8</span><span class=\"mtk1\">,</span><span class=\"mtk7\">21</span><span class=\"mtk1\">,</span><span class=\"mtk7\">11</span><span class=\"mtk1\">,</span><span class=\"mtk7\">22</span><span class=\"mtk1\">];</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lessThanTen</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">_</span><span class=\"mtk1\">.</span><span class=\"mtk11\">filter</span><span class=\"mtk1\">(</span><span class=\"mtk12\">numbers</span><span class=\"mtk1\">, </span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">number</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">number</span><span class=\"mtk1\"> &</span><span class=\"mtk12\">lt</span><span class=\"mtk1\">; </span><span class=\"mtk7\">10</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//lessThanTen is now</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">[</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">, </span><span class=\"mtk7\">8</span><span class=\"mtk1\">]</span></span></code></pre>\n<p>Works on collections and kitchen sink faucets.</p>\n<h2 id=\"_conclusion\" style=\"position:relative;\"><a href=\"#_conclusion\" aria-label=\"_conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>_.conclusion</h2>\n<p>Just kidding there's no _.conclusion method.</p>\n<p>I hope by now that you get the idea that if what you need to do isn't already a method, Underscore's _.map is a powerful tool for accomplishing whatever obscure collection manipulation your heart desires.</p>\n<p>So get out there, take a look through Underscore JS and start writing less obfuscated (nested) for loops with the help of _.each.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n</style>","frontmatter":{"date":"February 16, 2016","updated_date":null,"description":null,"title":"Be More Manipulative with Underscore JS","tags":["JavaScript","UnderscoreJs"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/11ed52d59476d63d8b5a6688fb02bdb9/ee604/underscore.png","srcSet":"/static/11ed52d59476d63d8b5a6688fb02bdb9/69585/underscore.png 200w,\n/static/11ed52d59476d63d8b5a6688fb02bdb9/497c6/underscore.png 400w,\n/static/11ed52d59476d63d8b5a6688fb02bdb9/ee604/underscore.png 800w,\n/static/11ed52d59476d63d8b5a6688fb02bdb9/f3583/underscore.png 1200w,\n/static/11ed52d59476d63d8b5a6688fb02bdb9/e4d72/underscore.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Zakary Hughes","github":null,"avatar":null}}}},{"node":{"excerpt":"LinkedIn has recently revamped their API systems and added many new restrictions. We will go through some examples on how you can utilize…","fields":{"slug":"/engineering/extended-linkedin-api-usage/"},"html":"<p>LinkedIn has recently revamped their API systems and added many new restrictions. We will go through some examples on how you can utilize the LinkedIn Javascript API in order to setup some useful features that comply with LinkedIn's new terms and conditions and use cases.</p>\n<h2 id=\"getting-your-site-ready\" style=\"position:relative;\"><a href=\"#getting-your-site-ready\" aria-label=\"getting your site ready permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting Your Site Ready</h2>\n<p>The first step will be setting up your login button which will prompt the user to authenticate with their LinkedIn credentials. We have provided a guide to getting a basic login button setup <a href=\"/integrate-linkedin-social-login-website/\">here</a>. The linked guide will get you as far as setting up a button that allows your users to login with LinkedIn and display a personalized welcome message. Below we will go over extending this functionality to allow you to handle more complex features for your users after logging in.</p>\n<h2 id=\"event-handling\" style=\"position:relative;\"><a href=\"#event-handling\" aria-label=\"event handling permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Event Handling</h2>\n<p>You can control and initiate specific behavior after a user logs in. You can assign these event handlers by first setting the function that will be used to initialize the events. This will trigger the event designation after the LinkedIn scripts have been loaded on your page. Update the LinkedIn initialization script:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">api_key: </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">authorize: </span><span class=\"mtk4\">true</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">onLoad: </span><span class=\"mtk12\">onLinkedInLoad</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>This will trigger the onLinkedInLoad function after the Linkedin scripts have been loaded.</p>\n<p>You can now assign some LinkedIn Event handlers in this function to control the behavior that will occur for different LinkedIn user actions. Let's begin by assigning the behavior that occurs after a user logs in.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">onLinkedInLoad</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Event</span><span class=\"mtk1\">.</span><span class=\"mtk11\">on</span><span class=\"mtk1\">(</span><span class=\"mtk12\">IN</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;auth&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getProfileData</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>The above event will trigger when a user authorizes and will call the getProfileData function. We can add another event assignment for the user logging out.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">onLinkedInLoad</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Event</span><span class=\"mtk1\">.</span><span class=\"mtk11\">on</span><span class=\"mtk1\">(</span><span class=\"mtk12\">IN</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;auth&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getProfileData</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Event</span><span class=\"mtk1\">.</span><span class=\"mtk11\">on</span><span class=\"mtk1\">(</span><span class=\"mtk12\">IN</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;logout&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">sendGoodByeMessage</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>The above logout event will trigger the sendGoodByeMessage when the user logs out. Now that we have the basic event handling in place we can handle the specific behavior for users logging in.</p>\n<h2 id=\"data-retrieval-and-api-access\" style=\"position:relative;\"><a href=\"#data-retrieval-and-api-access\" aria-label=\"data retrieval and api access permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Data Retrieval and API access</h2>\n<p>Once a user has logged in and triggered the getProfileData event we can pull in their user profile using the LinkedIn Raw data API handlers, these allow you to access any of LinkedIn's API endpoints and get data back. We will begin with a quick check to make sure the user is still authorized and then call the Raw API to pull in the people endpoint for the current user:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">getProfileData</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">User</span><span class=\"mtk1\">.</span><span class=\"mtk11\">isAuthorized</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">API</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Raw</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/people/~&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">result</span><span class=\"mtk1\">(</span><span class=\"mtk12\">onSuccess</span><span class=\"mtk1\">).</span><span class=\"mtk11\">error</span><span class=\"mtk1\">(</span><span class=\"mtk12\">onError</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>If the data is successfully returned it will call the onSuccess function and if not it will call onError.</p>\n<p>These functions will both include a JSON formatted response that can be used to display their profile data or log a message:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">onSuccess</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">onError</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>You can test the response formats for most of the LinkedIn APIs on <a href=\"https://apigee.com/console/linkedin\">LinkedIns API console</a> You can access any of the API endpoints after successful login via the raw API handler and retrieve data per your requirements.</p>\n<h2 id=\"user-management\" style=\"position:relative;\"><a href=\"#user-management\" aria-label=\"user management permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>User Management</h2>\n<p>Before making any API requests you should verify that your user has a current active session. User sessions are valid for 30 minutes by default. These sessions can be extended using the following call:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">User</span><span class=\"mtk1\">.</span><span class=\"mtk11\">refresh</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>The above call can be used to refresh the expiration time for the user but repeated calls may cause your app to be blocked so this should be used sparingly.</p>\n<p>You can provide the ability for your users to logout by setting up a button or link that will trigger the following function call:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">IN</span><span class=\"mtk1\">.</span><span class=\"mtk12\">User</span><span class=\"mtk1\">.</span><span class=\"mtk11\">logout</span><span class=\"mtk1\">(</span><span class=\"mtk12\">sendGoodByeMessage</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>This will trigger the same function that was assigned to the logout event.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n</style>","frontmatter":{"date":"February 09, 2016","updated_date":null,"description":null,"title":"Extended LinkedIn API Usage","tags":["LinkedIn","SocialLogin"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/a4e74ae24ffd6c107fe96587b9ac68eb/630fb/linkedin-feat-img.png","srcSet":"/static/a4e74ae24ffd6c107fe96587b9ac68eb/69585/linkedin-feat-img.png 200w,\n/static/a4e74ae24ffd6c107fe96587b9ac68eb/630fb/linkedin-feat-img.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Karl Wittig","github":null,"avatar":null}}}}]},"markdownRemark":{"excerpt":"Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie…","fields":{"slug":"/engineering/identity-impact-of-google-chrome-thirdparty-cookie-restrictions/"},"html":"<p>Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie restrictions for 1% of stable clients and 20% of Canary, Dev, and Beta clients.</p>\n<p><strong>What does it mean for user authentication?</strong></p>\n<p>On one hand, Google believes third-party cookies are widely used for cross-site tracking, greatly affecting user privacy. Hence, Google wants to phase out (or restrict) supporting third-party cookies in Chrome by early Q2 2025 (subject to regulatory processes).</p>\n<p>On the other hand, Google introduced Privacy Sandbox to support the use cases (other than cross-site tracking and advertising) previously implemented using third-party cookies.</p>\n<p>In this article, we’ll discuss:</p>\n<ul>\n<li>How is user authentication (identity) affected?</li>\n<li>What is Google offering as part of Privacy Sandbox to support various identity use cases when third-party cookies are phased out?</li>\n</ul>\n<h2 id=\"how-is-user-authentication-affected\" style=\"position:relative;\"><a href=\"#how-is-user-authentication-affected\" aria-label=\"how is user authentication affected permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is User Authentication Affected?</h2>\n<p>Third-party cookie restrictions affect user authentication in three ways, as follows.</p>\n<h3 id=\"external-identity-providers\" style=\"position:relative;\"><a href=\"#external-identity-providers\" aria-label=\"external identity providers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>External Identity Providers</h3>\n<p>If your website or app uses an external Identity Provider (IdP) — like LoginRadius, the IdP sets a third-party cookie when the user authenticates on your app.</p>\n<h3 id=\"web-sso\" style=\"position:relative;\"><a href=\"#web-sso\" aria-label=\"web sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Web SSO</h3>\n<p>If you have multiple apps across domains within your organization and authentication is handled using an IdP (internal or external) with web SSO, you already use third-party cookies to facilitate seamless access for each user using a single set of credentials.</p>\n<p>If you have implemented web SSO with one primary domain and multiple sub-domains of the primary domain, third-party cookie restrictions may not apply. For now, Google doesn’t consider the cookies set by sub-domains as third-party cookies, although this stance may change in the future.</p>\n<p>For example, you have apps at <code>example.com</code>, <code>travel.example.com</code>, <code>stay.example.com</code>, and web SSO is handled by <code>auth.example.com</code>. In this case, third-party cookie restrictions don’t apply.</p>\n<h3 id=\"federated-sso\" style=\"position:relative;\"><a href=\"#federated-sso\" aria-label=\"federated sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated SSO</h3>\n<p>Federated SSO is similar to, albeit different from, web SSO. It can handle multiple IdPs and applications—aka., Service Providers (SPs)—spanning multiple organizations. It can also implement authentication scenarios that are usually implemented through web SSO.</p>\n<p>Usually, authentication is handled on a separate pop-up or page when the user wants to authenticate rather than on the application or website a user visits. </p>\n<p>For example, you already use federated SSO if you facilitate authentication for a set of apps through multiple social identity providers as well as traditional usernames and passwords.</p>\n<blockquote>\n<p><strong>Note</strong>: It is also possible to store tokens locally, not within cookies. In this case, third-party cookie restrictions won’t affect token-based authentication. However, the restrictions still affect authentication where tokens are stored within third-party cookies (a common and secure method).</p>\n</blockquote>\n<h2 id=\"chromes-alternatives-for-third-party-cookies\" style=\"position:relative;\"><a href=\"#chromes-alternatives-for-third-party-cookies\" aria-label=\"chromes alternatives for third party cookies permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Chrome’s Alternatives for Third-Party Cookies</h2>\n<p>Google has been developing alternative features and capabilities for Chrome to replace third-party cookies as part of its Privacy Sandbox for Web initiative.</p>\n<p>Specific to authentication, Google recommends the following:</p>\n<ol>\n<li>Cookies Having Independent Partitioned State (CHIPS)</li>\n<li>Storage Access API</li>\n<li>Related Website Sets</li>\n<li>Federated Credential Management (FedCM) API</li>\n</ol>\n<h3 id=\"cookies-having-independent-partitioned-state-chips\" style=\"position:relative;\"><a href=\"#cookies-having-independent-partitioned-state-chips\" aria-label=\"cookies having independent partitioned state chips permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cookies Having Independent Partitioned State (CHIPS)</h3>\n<p><a href=\"https://developers.google.com/privacy-sandbox/3pcd/chips\">CHIPS</a> are a restricted way of setting third-party cookies on a top-level site without making them accessible on other top-level sites. Thus, they limit cross-site tracking and enable specific cross-site functionalities, such as maps, chat, and payment embeds.</p>\n<p>For example, a user visits <code>a.com</code> with a map embed from <code>map-example.com</code>, which can set a partitioned cookie that is only accessible on a.com. </p>\n<p>If the user visits <code>b.com</code> with a map embed from <code>map-example.com</code>, it cannot access the partitioned cookie set on <code>a.com</code>. It has to create a separate partitioned cookie specific to <code>b.com</code>, thus blocking cross-site tracking yet allowing limited cross-site functionality.</p>\n<p>You should specifically opt for partitioned cookies (CHIPS), which are set with partitioned and secure cookie attributes.</p>\n<p>If you’re using an external identity provider for your application, CHIPS is a good option to supplant third-party cookie restrictions. </p>\n<p>However, CHIPS may not be ideal if you have a web SSO or federated SSO implementation. It creates separate partitioned cookies for each application with a separate domain, which can increase complexity and create compatibility issues.</p>\n<h3 id=\"storage-access-api\" style=\"position:relative;\"><a href=\"#storage-access-api\" aria-label=\"storage access api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Storage Access API</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/storage-access-api\">Storage Access API</a>, you can access the local storage in a third-party context through iframes, similar to when users visit it as a top-level site in a first-party context. That is, it gives access to unpartitioned cookies and storage.</p>\n<p>Storage Access API requires explicit user approval to grant access, similar to locations, camera, and microphone permissions. If the user denies access, unpartitioned cookies and storage won’t be accessible in a third-party context.</p>\n<p>It is most suitable when loading cross-site resources and interactions, such as:</p>\n<p>Verifying user sessions when allowing interactions on an embedded social post or providing personalization for an embedded video.\nEmbedded documents requiring user verification status to be accessible.</p>\n<p>As it requires explicit user approval, it is advisable to use Storage Access API when you can’t implement an identity use case with the other options.</p>\n<h3 id=\"related-website-sets\" style=\"position:relative;\"><a href=\"#related-website-sets\" aria-label=\"related website sets permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Related Website Sets</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/related-website-sets\">Related Website Sets</a>, you can declare a <code>primary</code> website and <code>associatedSites</code> for limited purposes to grant third-party cookie access and local storage for a limited number of sites.</p>\n<p>Chrome automatically recognizes related website sets declared, accepted, and maintained in this open-source GitHub repository: <a href=\"https://github.com/GoogleChrome/related-website-sets\">Related Website Sets</a></p>\n<p>It provides access through Storage Access API directly without prompting for user approval, but only after the user interacts with the relevant iframe.</p>\n<p>It is important to declare a limited number of domains in related website sets that are meaningful and used for specific purposes. Google may block or suspend any exploitative use of this feature.</p>\n<p>The top-level site can also request approval for specific cross-site resources and scripts to Storage Access API using <code>resuestStorageAccessFor()</code> API.</p>\n<p>If you’re using an external identity provider for your web application, you can declare the domain of the identity provider in the related set to ensure limited third-party cookies and storage access to the identity provider, thus ensuring seamless user authentication.</p>\n<p>Related Website Sets can also work to supplement third-party cookie restrictions in web SSO and federated SSO if the number of web applications (or domains) is limited.</p>\n<h3 id=\"federated-credential-management-fedcm-api\" style=\"position:relative;\"><a href=\"#federated-credential-management-fedcm-api\" aria-label=\"federated credential management fedcm api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated Credential Management (FedCM) API</h3>\n<p>FedCM API enables federated SSO without third-party cookies.</p>\n<p>With FedCM API, a user follows these steps for authentication:</p>\n<ol>\n<li>The User navigates to a Service Provider (SP) — aka., Relying Party (RP)</li>\n<li>As the user requests to authenticate, the SP requests the browser through FedCM API to initiate authentication.</li>\n<li>The browser displays a list of available identity providers (supported by the RP), such as social IdPs like Google, Apple, LinkedIn, and Facebook, or other OAuth IdPs like LoginRadius.</li>\n<li>Once the user selects an IdP, the browser communicates with the IdP. Upon valid authentication, the IdP generates a secure token.\nThe browser delivers this secure token to the RP to facilitate user authorization.</li>\n</ol>\n<p>You can access a user demo of FedCM here: <a href=\"https://fedcm-rp-demo.glitch.me/\">FedCM</a>. </p>\n<p>For more information about implementing federated SSO with FedCM API, go through the <a href=\"https://developers.google.com/privacy-sandbox/3pcd/fedcm-developer-guide\">FedCM developer guide</a>.</p>\n<h2 id=\"how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" style=\"position:relative;\"><a href=\"#how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" aria-label=\"how is loginradius preparing for the third party cookie phase out permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is LoginRadius Preparing for the Third-party Cookie Phase-out?</h2>\n<p>Firstly, we’re committed to solving our customers' user identity pain points — and preparing for the third-party cookies phase-out is no different.</p>\n<p>We’ll implement the most relevant and widely useful solutions to facilitate a smooth transition for our customers.</p>\n<p>Please subscribe to our blog for more information. We’ll update you on how we help with the third-party cookie phase-out.</p>\n<h2 id=\"in-conclusion\" style=\"position:relative;\"><a href=\"#in-conclusion\" aria-label=\"in conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In Conclusion</h2>\n<p>The proposed changes to phase out third-party cookies and suggested alternatives are evolving as Google has been actively collaborating and discussing changes with the border community.</p>\n<p>Moreover, browsers like Firefox, Safari, and Edge may approach restricting third-party cookies differently than Google does.</p>\n<p>From LoginRadius, we’ll keep you updated on what we’re doing as a leading Customer Identity and Access Management (CIAM) vendor to prepare for the third-party cookie phase-out.</p>\n<h2 id=\"glossary\" style=\"position:relative;\"><a href=\"#glossary\" aria-label=\"glossary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Glossary</h2>\n<p><strong>Top-level site</strong>: It is the primary site a user has visited.</p>\n<p><strong>First-party cookie</strong>: A cookie set by the top-level site.</p>\n<p><strong>Third-party cookie</strong>: A cookie set by a domain other than the top-level site. For example, let’s assume that a user has visited <code>a.com</code>, which might use an embed from <code>loginradius.com</code> to facilitate authentication. If <code>loginradius.com</code> sets a cookie when the user visits <code>a.com</code>, it is called a third-party cookie as the user hasn’t directly visited <code>loginradius.com</code>.</p>\n<h2 id=\"references\" style=\"position:relative;\"><a href=\"#references\" aria-label=\"references permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>References</h2>\n<ul>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/prepare/prepare-for-phaseout\">Changes to Chrome's treatment of third-party cookies</a></li>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/guides/identity\">Check the impact of the third-party cookie changes on your sign-in workflows</a></li>\n</ul>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"July 08, 2024","updated_date":null,"description":"Google Chrome has planned to phase out third-party cookies, which will affect different website functionalities depending on third-party cookies. This blog focuses on how this phase-out affects identity and user authentication and discusses alternatives for overcoming challenges.","title":"How Chrome’s Third-Party Cookie Restrictions Affect User Authentication?","tags":["Identity","Cookies","Chrome"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png","srcSet":"/static/eb7396060c0adc430dbed2d04b63d431/69585/third-party-cookies-phaseout-chrome.png 200w,\n/static/eb7396060c0adc430dbed2d04b63d431/497c6/third-party-cookies-phaseout-chrome.png 400w,\n/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png 800w,\n/static/eb7396060c0adc430dbed2d04b63d431/f3583/third-party-cookies-phaseout-chrome.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Raghunath Reddy","github":"raghunath-r-a","avatar":null}}}},"pageContext":{"limit":6,"skip":252,"currentPage":43,"type":"//engineering//","numPages":52,"pinned":"17fa0d7b-34c8-51c4-b047-df5e2bbaeedb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}