<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jitendra Bunkar on Medium]]></title>
        <description><![CDATA[Stories by Jitendra Bunkar on Medium]]></description>
        <link>https://medium.com/@mr.techie?source=rss-d73a3db33d3d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ExuJZZz0sXZ1VUcjq4p9TQ.jpeg</url>
            <title>Stories by Jitendra Bunkar on Medium</title>
            <link>https://medium.com/@mr.techie?source=rss-d73a3db33d3d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:30:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mr.techie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enable AWS SES Email Tracking ( Open/Click )]]></title>
            <link>https://blog.stackademic.com/enable-aws-ses-email-tracking-open-click-f01f1e83bd2a?source=rss-d73a3db33d3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f01f1e83bd2a</guid>
            <category><![CDATA[s]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-sns]]></category>
            <category><![CDATA[mail-tracking]]></category>
            <dc:creator><![CDATA[Jitendra Bunkar]]></dc:creator>
            <pubDate>Sat, 18 Oct 2025 21:31:54 GMT</pubDate>
            <atom:updated>2025-10-31T13:25:20.164Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>— — — — — — — — — — — — — — — — —</strong></p><p>In this guide, I’ll walk you through setting up email monitoring, open tracking, and click tracking in AWS SES using <strong>SNS webhooks</strong>, based on the latest AWS documentation as of October 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l79tibB4VC7G58a184qhAA.png" /></figure><p><strong>Before we dive in:</strong><br> Make sure your <strong>AWS SES account is already in production mode</strong> (not the sandbox), and that you can <strong>send emails successfully without any tracking enabled yet</strong>.</p><p>This ensures everything’s working smoothly before we add the open and click tracking magic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*II_ccW3pISUwoXyw9HPiQQ.png" /><figcaption>(This image shows that my SES account is already in production)</figcaption></figure><p><strong>Step 1: Create a Configuration Set</strong><br> Head over to your<strong> </strong>AWS SES console and create a new <strong>Configuration Set</strong>.<br> Inside it, add an <strong>Event Destination</strong> — select the <strong>event types</strong> you want to track (you can refer to the image below for guidance).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKaZHCCCi7VokX4UsgmWFw.png" /><figcaption>(In my case configuration set name is <strong>‘mailer-configuration-set’</strong>, and destination name is ‘<strong>mailer-destination</strong>’)</figcaption></figure><p>Make sure the <strong>destination</strong> is set to <strong>Amazon SNS</strong>, and don’t forget to <strong>enable</strong> the event destination before saving.</p><p>Make Sure <strong><em>Open and Click Tracking</em></strong> are checked ✅in the destination configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUPMUQuvHYiYfQeqM95Y1A.png" /></figure><p><strong>Step 2: Set Up an SNS Topic</strong><br> Next, create a <strong>new SNS topic</strong> (choose <strong>Standard</strong> type).<br>Select the <strong>HTTPS protocol</strong>, check the <strong>“Raw message delivery”</strong> option, and then —&gt; in the <strong>endpoint field</strong> —&gt; enter the <strong>URL of your mail server</strong> where you want to receive and process SNS events.</p><p>This endpoint is where your application can update email tracking status in your database in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*RBMR4uwrWM4MnvBR-X1b5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*8SRxq0pxeqXCHSBjT-pXQg.png" /></figure><p><strong>Hint:</strong> If you’re just testing, you can use a <strong>Cloudflare Tunnel</strong> (or similar) to expose your local server to the internet.<br> Once your mailer service is deployed, simply replace that temporary URL with your <strong>production HTTPS endpoint</strong> — and you’re good to go!</p><p><strong>Next, let’s create our Webhook Endpoint</strong></p><p>Now it’s time to build a <strong>webhook endpoint</strong> in a <strong>Node.js server (In My Case)</strong> — this is where AWS SNS will send all the email event data (like opens, clicks, deliveries, etc.).</p><p>You can add this endpoint directly to your existing <strong>mailer server</strong> or set it up as a standalone microservice — whatever fits your setup best.</p><p>Below is an example implementation to get you started. You can use it as-is or adapt it to your own server structure.</p><pre>const express = require(&quot;express&quot;);<br>const crypto = require(&quot;crypto&quot;);<br>const axios = require(&quot;axios&quot;);<br>const { EmailLog, BulkBatch } = require(&quot;../models/MailerSchemas&quot;);<br><br><br>const router = express.Router();<br><br><br>// SNS Event Receiver<br>router.post(&quot;/ses/events&quot;, express.json({ type: &quot;*/*&quot; }), async (req, res) =&gt; {<br>  try {<br>    const messageType = req.headers[&quot;x-amz-sns-message-type&quot;];<br>    let body = req.body;<br><br><br>    // console.log(&quot;Incoming SNS:&quot;, JSON.stringify(body, null, 2));<br><br><br>    // 1. Handle Subscription Confirmation<br>    if (messageType === &quot;SubscriptionConfirmation&quot; &amp;&amp; body.SubscribeURL) {<br>      console.log(&quot;Confirming SNS subscription...&quot;);<br>      await axios.get(body.SubscribeURL);<br>      return res.status(200).send(&quot;Subscription confirmed&quot;);<br>    }<br><br><br>    // 2. Handle Notification<br>    if (messageType === &quot;Notification&quot;) {<br>      // If raw delivery is OFF → need to parse body.Message<br>      const notification =<br>        typeof body.Message === &quot;string&quot; ? JSON.parse(body.Message) : body;<br><br><br>      const eventType = notification.eventType;<br>      const mail = notification.mail;<br>      const sesMessageId = mail?.messageId;<br><br><br>    //   console.log(&quot; SES event:&quot;, eventType, &quot;MessageId:&quot;, sesMessageId);<br><br><br>      let update = {};<br>      switch (eventType) {<br>        case &quot;Send&quot;:<br>          update = { status: &quot;Sent&quot; };<br>          break;<br>        case &quot;Delivery&quot;:<br>          update = { status: &quot;Delivered&quot; };<br>          break;<br>        case &quot;Bounce&quot;:<br>          update = {<br>            status: &quot;Bounced&quot;,<br>            error: notification.bounce?.bounceType,<br>          };<br>          break;<br>        case &quot;Complaint&quot;:<br>          update = {<br>            status: &quot;Complaint&quot;,<br>            error: notification.complaint?.complaintFeedbackType,<br>          };<br>          break;<br>        case &quot;Open&quot;:<br>          update = { isOpened: true };<br>          break;<br>        case &quot;Click&quot;:<br>          update = { isClicked: true };<br>          break;<br>        default:<br>          console.log(&quot; Unhandled SES event:&quot;, eventType);<br>      }<br><br><br>      if (sesMessageId) {<br>        await EmailLog.findOneAndUpdate(<br>          { sesMessageId },<br>          { $set: update },<br>          { new: true }<br>        );<br>      }<br>    }<br><br><br>    res.status(200).send(&quot;OK&quot;);<br>  } catch (err) {<br>    console.error(&quot; SES webhook error:&quot;, err);<br>    res.status(500).send(&quot;Error&quot;);<br>  }<br>});<br><br><br>module.exports = router;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*-P2IddZSSF6xBd0Q0V0Sxw.png" /></figure><p>That’s it — your <strong>AWS SES + SNS email tracking</strong> pipeline is now live!</p><p>From now on, every open, click, and delivery event will flow straight into your backend, ready for analytics or automation.</p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f01f1e83bd2a" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/enable-aws-ses-email-tracking-open-click-f01f1e83bd2a">Enable AWS SES Email Tracking ( Open/Click )</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between ANI, AGI and ASI?]]></title>
            <link>https://blog.stackademic.com/difference-between-ani-agi-and-asi-388d9c9dd78b?source=rss-d73a3db33d3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/388d9c9dd78b</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[revolutionary]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[sia]]></category>
            <dc:creator><![CDATA[Jitendra Bunkar]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 06:17:10 GMT</pubDate>
            <atom:updated>2025-12-15T15:52:37.959Z</atom:updated>
            <content:encoded><![CDATA[<h3>Difference Between ANI, AGI, and ASI?</h3><p>In this article, We will see how ANI, AGI, and ASI three types of AI are different from each other and what capabilities each have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w4FNBXwT2Vn387wCyVEMPg.jpeg" /></figure><p>Let’s dive deep …</p><p><strong>-ANI</strong> stands for <strong>Artificial Narrow Intelligence</strong> which is arising nowadays with lots of mind-blowing capabilities like text generation, text-to-image generation, text-to-video generation and now real-time conversation (with Gpt4o, Gemini) But still, AI does not have a basic understanding (in the context of emotions) that it recognise what to do or what not on human command (PS. ANI follows the command of human and not capable enough to decide whether it is wrong or right).</p><p><strong>-AGI</strong> stands for <strong>Artificial General Intelligence </strong>which is capable of making decisions and having consciousness like humans means machines do not require human input to be programmed to function. AGI is capable of solving complex problems. AGI will also be self-aware and will improve knowledge and skills over time. Basically, we can say it is a copy of the human brain with more neurons.</p><p>AI-based movies like Transcendence explain AGI very well and what could be consequences when a machine has consciousness like humans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHMWWUrz0Kdm8BTMoNI3kw.jpeg" /></figure><p>-<strong>ASI</strong> stands for <strong>Artificial Super Intelligence </strong>which enough capable of replacing human intelligence capabilities and would be smarter than humans. ASI will come up with a copy of the human brain with a hundred times more neurons than the actual human brain and with lots of advanced capabilities.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a> | <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=388d9c9dd78b" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/difference-between-ani-agi-and-asi-388d9c9dd78b">Difference between ANI, AGI and ASI?</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up Webpack and build React extensions]]></title>
            <link>https://blog.stackademic.com/how-to-set-up-webpack-and-build-react-extension-a68ce191523e?source=rss-d73a3db33d3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a68ce191523e</guid>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Jitendra Bunkar]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 21:31:25 GMT</pubDate>
            <atom:updated>2025-12-15T15:42:20.415Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will show you how to build a web extension using React Js and Node Js. A web extension is a small software program that modifies and enhances the functionality of a web browser. You can use web extensions to customize your browsing experience, add new features, or integrate with other services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSwmINaFeL4ncfelNS5wgg.jpeg" /><figcaption>Ai generated image</figcaption></figure><h3>Technologies I’m using</h3><p><em>React v</em>18.2.0 <em>/Node.js v18.12.</em></p><p>Follow these steps to achieve our goal</p><ol><li>Make a react app using npm create-react-app yourappname</li></ol><p><strong>2</strong>. To install Webpack eject the application using npm run eject, it shows a warning ``This command is a one-way operation, and once you have ejected from Create React App set up, you can’t undo it.`` and asks you to whether you want to run this command or not you have to go with <strong>Yes.</strong> and let’s wait until it sets all the files for us.</p><p>After ejecting our app folder looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*JPE4uph0yYTF9rCXSY26Dg.png" /><figcaption>Folder structure after ejecting the app</figcaption></figure><p><strong>3</strong>. Now it’s time to configure the heart of an extension, yes, I’m talking about the <strong>Manifest.json</strong> file. But why I am calling it the heart of an extension, cause the <strong>Manifest.json</strong> file is a configuration file that provides important information about a Chrome extension to the Chrome browser. It is the only file that every extension using WebExtension APIs <strong>must</strong> contain.</p><p>Let’s understand the different parts of the manifest.js file through this image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vmY4v4zjyCLZDekRd3FVIg.png" /></figure><p><strong>What does the Webpack do?</strong><br> Webpack is a static module bundler for JavaScript applications — it takes all the code from our application and makes it usable in a web browser. Modules are reusable chunks of code built from your app’s JavaScript, node_modules, images, and CSS styles which are packaged to be easily used in our application.</p><p>The configuration used to accomplish all of this is the foundation of the Webpack React app. With models four and up, Webpack provides acceptable settings out of the box, so there may be no need to write a configuration file. For each non-trivial task, you’ll need to provide a unique webpack.config.js record, so you should specify how the documents and properties should be changed and what kind of output should be produced.</p><p><strong>4. </strong>You have to perform the following changes to configure Webpack according to our use case:</p><p>a) In config/paths.js file :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knDrsHg1zAr-SRyjcipypg.png" /></figure><p>b) In config/webpack.config.js:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upExJR86wZPTC-RU66YeBg.png" /><figcaption>Assign the title and template for the extension</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIMnOkHVynU1nfZLWQ-x8Q.png" /><figcaption>Edit entry point with content.js and background.js</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YEIhphGLOePMVPKNRxx5mg.png" /><figcaption>This removes hash content in the name of the file</figcaption></figure><p>Hurray! The app is set up and ready for further development, now you can code this extension like a normal React app.</p><p>Now it’s time to create a basic extension that inserts a popup in the DOM of the YouTube comment section.<br>Here is the GitHub repo <a href="https://github.com/jitendrakumar025/React_extension">link</a> for the code of this extension, you can fork and test it on your system and learn.</p><h3>Conclusion</h3><p>That’s all folks :), You can use different frameworks and React hooks to power your extensions.</p><p>If anything is unclear, don’t hesitate to leave a comment.</p><h3>Stackademic</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a68ce191523e" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/how-to-set-up-webpack-and-build-react-extension-a68ce191523e">How to set up Webpack and build React extensions</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Your Git Commits: A Guide to Verified Commits with GPG and SSH Keys]]></title>
            <link>https://blog.stackademic.com/securing-your-git-commits-a-guide-to-verified-commits-with-gpg-and-ssh-keys-e82297626bc7?source=rss-d73a3db33d3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e82297626bc7</guid>
            <category><![CDATA[git-commit]]></category>
            <category><![CDATA[gpg-key]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[secure-commit]]></category>
            <category><![CDATA[verified-git-commit]]></category>
            <dc:creator><![CDATA[Jitendra Bunkar]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 23:31:35 GMT</pubDate>
            <atom:updated>2025-12-15T15:49:34.018Z</atom:updated>
            <content:encoded><![CDATA[<p>Discover how to safeguard the integrity of your Git commits by implementing <strong>GPG keys</strong> and <strong>SSH keys</strong>. This detailed guide will walk you through the process of setting up and utilizing these mechanisms to ensure the authenticity and non-repudiation of your commits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-AU4A0vPbWSHnRt3-zLzw.jpeg" /></figure><p>Let’s begin by discussing the process of creating a GPG key and adding it to your GitHub account. Afterwards, we’ll explore how to do the same with an SSH key.</p><h3><strong>Commit signature verification using GPG Keys</strong></h3><p>To sign commits using GPG and have those commits verified on GitHub, follow these steps:</p><ol><li>Download and install GPG for Windows<br>You can download GPG from the <a href="https://gpg4win.org/download.html"><strong>https://www.gpg4win.org/</strong></a></li></ol><p>2. Generate new GPG key<br>Open Windows PowerShell and run the command `<strong><em>gpg — full-generate-key`</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*cDsgrwJv6L4ehMbsgwep_A.png" /><figcaption>Choose the above properties of the key</figcaption></figure><p>Then enter your details to identify your key. To protect the private key enter a secure passphrase.</p><p>3. List the GPG Key with key IDs<strong><br></strong>Check your key using the command:-<br><strong> <em>gpg — list-secret-keys — keyid-format LONG</em></strong></p><p>This will return<em> </em><strong><em>sec rsa4096/YOUR-KEY-ID, </em></strong>copy your-key-id to generate a public key block.</p><p>4. Export your public key<br> Use the command <strong><em>gpg — armor — export YOUR-KEY-ID<br> </em></strong><em>Don’t forget to replace </em><strong><em>YOUR-KEY-ID</em></strong><em> with your generated ID. This command will generate a PGP public key block.</em></p><pre>-----BEGIN PGP PUBLIC KEY BLOCK-----<br><br>mQINBFRUAGoBEACuk6ze2V2pZtScf1Ul25N2CX19AeL7sVYwnyrTYuWdG2FmJx4x<br>DLTLVUazp2AEm/JhskulL/7VCZPyg7ynf+o20Tu9/6zUD7p0rnQA2k3Dz+7dKHHh<br>eEsIl5EZyFy1XodhUnEIjel2nGe6f1OO7Dr3UIEQw5JnkZyqMcbLCu9sM2twFyfa<br>a8JNghfjltLJs3/UjJ8ZnGGByMmWxrWQUItMpQjGr99nZf4L+IPxy2i8O8WQewB5<br><br>[... snip - -- example of key block ...]<br><br>fvfidBGruUYC+mTw7CusaCOQbBuZBiYduFgH8hRW97KLmHn0xzB1FV++KI7syo8q<br>XGo8Un24WP40IT78XjKO<br>=nUop<br>-----END PGP PUBLIC KEY BLOCK-----</pre><p>5. Add GPG key to GitHub account<br> — Copy the entire PGP public key block.<br> — Go to your GitHub profile settings.<br> — Locate the “SSH and GPG keys” section.<br> — Click the “New GPG key” button.<br> — Give the key a suitable title.<br> — Paste the copied PGP public key block into the text box.<br> — Click the “Add GPG key” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgfAOV11NTco2qQhGmLPdQ.png" /></figure><p>6. Configure Git on windows<br> Use the following few commands and tell the git who are you, what is your signing key and other configuration.</p><p>a) git config — global user.name “<strong><em>YOUR-NAME</em></strong>” <br>b) git config — global user.email “<strong><em>YOUR-EMAIL</em></strong>”<br>c) git config — global user.signingkey <strong><em>YOUR-KEY-ID</em></strong><br>d) git config — global commit.gpgsign true <br>e) git config — global tag.gpgsign true <br>f) git config — global gpg.program “<strong><em>C:\Program Files (x86)\gpg.exe_file_location</em></strong>”<br>To see the location of gpg.exe file run the command where gpg in command prompt, in my case it is C:\Program Files (x86)\GnuPG\bin\gpg.exe</p><p>Now recheck your configuration details using git config --global --list</p><p>Once you have verified that all the details are correct, you can proceed with committing your changes to GitHub using your verified signature. During<br>the initial commit, GPG will prompt you to enter your passphrase for verification. After this initial verification, you won’t be asked for your<br>passphrase again. Your changes will be committed to GitHub, and the<br>commit will be marked as verified. This verification indicates that the commit was made by you and from your computer, ensuring its<br>authenticity and integrity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qp2KUKAtUL9SyLpt4FKGEw.png" /><figcaption>The Verified Git commit</figcaption></figure><h3>Commit signature verification using SSH Keys</h3><p>To sign commits using SSH and have those commits verified on GitHub, follow these steps:<br>1. Generate new SSH key<br> When you generate an SSH key, you can add a passphrase to further secure the key. Whenever you use the key, you must enter the passphrase. If your key has a passphrase and you don’t want to enter the passphrase every time you use the key, you can add your key to the SSH agent. The SSH agent manages your SSH keys and remembers your passphrase.</p><p>a) Open git bash<br>b) Paste the text below, replacing the email used in the example with your GitHub email address.<br>ssh-keygen -t ed25519 -C &quot;your_email@example.com&quot; <br>This creates a new SSH key, using the provided email as a label.<br>&gt; Generating public/private ALGORITHM key pair</p><p>When prompted to save the SSH key, you can accept the default file location by pressing Enter. However, if you have previously created SSH keys, the system may ask you to overwrite one of them. In this case, it’s recommended to create a custom-named SSH key. To do this, type the default file location and replace “id_ALGORITHM” with your desired key name.<br>&gt; Enter a file in which to save the key (/c/Users/YOU/.ssh/id_ALGORITHM):[Press enter]</p><p>c) At the prompt, type a secure passphrase.<br>&gt; Enter passphrase (empty for no passphrase): [Type a passphrase]<br>&gt; Enter same passphrase again: [Type passphrase again]</p><p>2. Adding a new SSH key to your account<br> You can either use an SSH key for authentication or for signing commits, or you can use it for both purposes. However, if you want to use the same SSH key for both authentication and signing, you need to upload it twice.</p><blockquote>a) Copy the SSH public key to your clipboard<br> clip &lt; ~/.ssh/id_ed25519.pub <br>#Copies the contents of the <strong>id_ed25519.pub</strong> file to your clipboard</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkYsnjTCK5prhCUbj3zW_g.png" /><figcaption>Add the SSH key as shown in this picture</figcaption></figure><p>b) Click <strong><em>Add SSH key</em></strong><br>c)If prompted, confirm access to your account on GitHub.</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e82297626bc7" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/securing-your-git-commits-a-guide-to-verified-commits-with-gpg-and-ssh-keys-e82297626bc7">Securing Your Git Commits: A Guide to Verified Commits with GPG and SSH Keys</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I used Passport js and Manual LinkedIn API Hit to Achieve Successful Authentication]]></title>
            <link>https://blog.stackademic.com/how-i-used-passport-js-and-manual-linkedin-api-hit-to-achieve-successful-authentication-6adb3d224de4?source=rss-d73a3db33d3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6adb3d224de4</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[linkedin]]></category>
            <category><![CDATA[linkedin-api]]></category>
            <category><![CDATA[passportjs]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Jitendra Bunkar]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 12:36:01 GMT</pubDate>
            <atom:updated>2025-12-15T15:56:27.053Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Used Passport.js and Manual LinkedIn API Hit to Achieve Successful Authentication</h3><p>In this article, I will show you how to implement LinkedIn authentication middleware using passport js, and how to fix the error ‘failed to fetch user profile’ caused by the upgradation of the LinkedIn API to the new Community Management API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-yTMcUQ_xq2JlGH387JqyQ.jpeg" /></figure><h3><strong>Technologies I’m using</strong></h3><p><em>React v</em>18.2.0 <em>/Node.js v18.12.1</em></p><p>Passport js is a popular middleware for Node.js that simplifies the process of authenticating users with various strategies, such as local, OAuth, OpenID, etc. One of the strategies that Passport JS supports is LinkedIn, which allows users to log in with their LinkedIn credentials and access their profile information.</p><p>However, recently LinkedIn has changed its APIs to a new Community Management API, which requires different scopes and permissions for accessing user data. This has caused some issues with passport js, as it is not updated to use the new APIs. As a result, when you try to authenticate a user with LinkedIn using passport js, you may encounter an error like this:</p><blockquote>InternalOAuthError: failed to fetch user profile</blockquote><p>This error means that passport js cannot retrieve the user profile information from LinkedIn using the access token that it obtained. This is because the npm package of passport-linkedin-oauth2 was not updated for new LinkedIn API updates.</p><p>I suppose that you have successfully configured your LinkedIn Developer account and created a new app that has enabled the following product: Sign In with LinkedIn using OpenID Connect, Share on LinkedIn, and the app should have `openid, profile, and email` OAuth 2.0 scopes.</p><p>In your app settings, add your callback URL, which is where LinkedIn will redirect the user after authentication. For example, if you are using localhost:3000 as your server, your callback URL could be <a href="http://localhost:3000/auth/linkedin/callback.">http://localhost:3000/auth/linkedin/callback.</a></p><h3><strong>1. Register for the LinkedIn Oauth2 Passport Strategy</strong></h3><p>Currently the version of `passport-linkedin-oauth2` is `2.0.0` which isn’t up to date.</p><pre>require(&#39;dotenv&#39;).config();<br>const LinkedInStrategy = require(&quot;passport-linkedin-oauth2&quot;).Strategy;<br>const passport = require(&quot;passport&quot;);<br><br>passport.serializeUser((user, done) =&gt; {<br>    done(null, user);<br>  });<br><br>  passport.deserializeUser((user, done) =&gt; {<br>    done(null, user);<br>});<br>  <br>  passport.use(<br>    new LinkedInStrategy(<br>      {<br>        clientID: process.env.LINKEDIN_CLIENT_ID,<br>        clientSecret: process.env.LINKEDIN_CLIENT_SECRET,<br>        callbackURL: &#39;/auth/linkedin/callback&#39;,<br>        scope: [&#39;openid&#39;, &#39;profile&#39;, &#39;email&#39;],<br>        state: true,<br>      },<br>      function (req, accessToken, refreshToken, profile, done) {<br>        // asynchronous verification, for effect...<br>        req.session.accessToken = accessToken;<br>        process.nextTick(function () {<br>          // To keep the example simple, the user&#39;s Linkedin profile is returned to<br>          // represent the logged-in user.  In a typical application, you would want<br>          // to associate the Linkedin account with a user record in your database,<br>          // and return that user instead.<br>          return done(null, profile);<br>        });<br>      }<br>    )<br>  );</pre><h3>2. Frontend Part</h3><pre>const linkedInlogin = async () =&gt; {<br>  window.open(&quot;https://your_running_server_url/auth/linkedin&quot;, &quot;_self&quot;);<br>  console.log(&quot;api hit!&quot;);<br> };</pre><h3>3. Backend Part</h3><h4>Code Overview</h4><p>We’ll break down the code step by step:</p><p>We create a new route that initiates the LinkedIn authentication process. When users visit this route, they are redirected to LinkedIn for sign-in. The passport.authenticate middleware is used to handle the LinkedIn authentication flow. By setting passReqToCallback: true, we pass the request object to the authentication callback, allowing us to access request-specific information.</p><pre>router.get(<br> &quot;/linkedin&quot;,<br> passport.authenticate(&quot;linkedin&quot;, {<br>  state: &quot;some&quot;,<br>  passReqToCallback: true,<br> }),<br> (req, res) =&gt; {}<br>);</pre><p>In general case only this works for successful LinkedIn authentication and it fetches user info from LinkedIn successfully, But after updates in LinkedIn Community API’s current npm version of passport-linkedin-oauth2 is not working. <br>So we have to manually hit the LinkedIn access token API. This means reaching out to LinkedIn’s API directly to get the access tokens we need for authentication.</p><h4>1. LinkedIn Authentication</h4><p>We start by creating a route for the LinkedIn callback. This route handles the LinkedIn OAuth flow. The user is redirected to LinkedIn for authentication, and upon successful authentication, LinkedIn redirects the user back to your application with an authorization code.</p><h4>2. Access Token Retrieval</h4><p>Once we have the authorization code, we use it to request an access token from LinkedIn. The access token is necessary to make authenticated requests on behalf of the user.</p><h4>3. Fetching User Data</h4><p>With the access token in hand, we can fetch the user’s data from LinkedIn. This data includes the user’s LinkedIn ID, name, email, and profile picture.</p><h4>4. Storing User Data</h4><p>We check if the user exists in our database using their LinkedIn ID. If not, we create a new user record. This allows users to sign in with their LinkedIn accounts, and their data is stored in our application.</p><h4>5. Generating JWT Token</h4><p>To maintain user sessions, we generate a JSON Web Token (JWT) with user information. This token can be used for user authentication in your application.</p><h4>6. Redirect</h4><p>After successful authentication and data storage, we redirect the user to their dashboard with the JWT token included in the query parameter.</p><pre>router.get(&quot;/linkedin/callback&quot;, async (req, res) =&gt; {<br> try {<br>  console.log(req.query.id);<br> //here we get this code from passport linkedin strategy.<br>  const code = req.query.code;<br>  console.log(&quot;code--&gt; &quot;, code);<br><br>  const redirect_uri = &quot;https://your_running_server_url/auth/linkedin/callback&quot;;<br>  var access_token;<br>  //step 2 : access token retrieval<br>  const access_token_url = `https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&amp;code=${code}&amp;redirect_uri=${redirect_uri}&amp;client_id=${client_id}&amp;client_secret=${client_secret}`;<br>  const res_token = await axios<br>   .post(access_token_url)<br>   .then((res) =&gt; {<br>    access_token = res.data.access_token;<br>   })<br>   .catch((err) =&gt; {<br>    console.log(err);<br>   });<br><br>  //console.log(&quot;access_token--&gt; &quot;,access_token);<br><br>  // step 3: Fetching User Data<br>  const user_info_url = `https://api.linkedin.com/v2/userinfo`;<br>  if (access_token) {<br>   const res_user_info = await axios<br>    .get(user_info_url, {<br>     headers: {<br>      Authorization: `Bearer ${access_token}`,<br>     },<br>    })<br>    .then((response) =&gt; {<br>     user_info = response.data;<br>     // res.send(res.data);<br>    })<br>    .catch((err) =&gt; {<br>     console.log(&quot;ERROR: &quot;, err);<br>    });<br>  } else {<br>   console.log(&quot;access_token not found&quot;);<br>  }<br>  <br>  //step 4: Storing User Data<br>  if (user_info) {<br><br>   user_info1 = user_info;<br><br>   const LinkedinID = user_info.sub;<br>   const name = user_info.name;<br>   const email = user_info.email;<br>   const picture = user_info.picture<br>    ? user_info.picture<br>    : &quot;https://t3.ftcdn.net/jpg/03/64/62/36/360_F_364623623_ERzQYfO4HHHyawYkJ16tREsizLyvcaeg.jpg&quot;;<br>     <br>   // code to store user information to database <br>      <br>     } else {<br>      user_info1 = results[0];<br>      // console.log(&quot;user found&quot;,user_info1);<br>     }<br>    }<br>   );<br><br>   //step 5: Generating JWT Token<br>   const token = jwt.sign(<br>    { LinkedinID: LinkedinID, name: name, email: email, picture: picture },<br>    process.env.JWT_SECRET<br>   );<br><br>  //step 6: this will redirect user to home page after successful login/authentication<br>   res.redirect(`https://your_frontend_url/home?token=${token}`);<br>  }<br> } catch (error) {<br>  res.status(500).json({<br>   message: &quot;Internal Server Error&quot;,<br>   error,<br>  });<br> }<br>});</pre><p><strong>User verification from the client side</strong></p><pre>router.post(&quot;/getinfo&quot;, (req, res) =&gt; {<br>    try {<br>        const payload = jwt.verify(req.body.token, process.env.JWT_SECRET);<br>        console.log(&quot;payload.&quot;, payload);<br>        res.status(200).json({<br>            message: &quot;User Verified&quot;,<br>            user: payload,<br>        });<br>    } catch (error) {<br>        res.status(500).json({<br>            message: &quot;Internal Server Error&quot;,<br>            error: error,<br>        });<br>    }<br>});</pre><ol><li>We’ve defined a route at “/getinfo” as a POST request. This is where clients will send a JWT token for verification.</li><li>Inside the route, we attempt to verify the token using the jwt.verify function. The process.env.JWT_SECRET is the secret key needed to decode the token. If the token is valid, the decoded user information is stored in the payload.</li><li>If verification is successful, we respond with a status code 200 and a JSON object confirming that the user is verified along with the user’s information. If there’s an error during the verification process, we return a status code 500 along with an error message.</li></ol><h3>Conclusion</h3><p>That’s all folks :)</p><p>If anything is unclear, don’t hesitate to leave a comment.</p><p>Here‘s the LinkedIn documentation link for the authentication.</p><p><a href="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2">https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin%2Fcontext&amp;tabs=HTTPS</a></p><p>Thank you very much!</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6adb3d224de4" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/how-i-used-passport-js-and-manual-linkedin-api-hit-to-achieve-successful-authentication-6adb3d224de4">How I used Passport js and Manual LinkedIn API Hit to Achieve Successful Authentication</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>