{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/58","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"All React developers love to leverage the benefits React caters to in developing web applications. But developers need to keep in mind the…","fields":{"slug":"/engineering/react-security-vulnerabilities/"},"html":"<p>All React developers love to leverage the benefits React caters to in developing web applications. But developers need to keep in mind the security postures while creating React web apps. React applications face a vast attack surface and are prone to different vulnerabilities. This article is a checklist of React security best practices that every developer should know before diving into PWA (progressive web application) development.\nIf you are new to progressive web applications and React, let's get familiar with these terminologies first.</p>\n<h2 id=\"what-are-progressive-web-applications-pwa\" style=\"position:relative;\"><a href=\"#what-are-progressive-web-applications-pwa\" aria-label=\"what are progressive web applications pwa 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>What are Progressive Web Applications (PWA)?</h2>\n<p>Progressive Web Apps (PWA) are apps built using web technologies like HTML, CSS, and JavaScript (JS). But these apps deliver the experience, feel, and functionality of a native app. PWA combines new technologies and integrations to build a reliable, engaging, accessible, and secure application. Developers mostly use React on top of HTML and JavaScript to build a progressive web app.</p>\n<h2 id=\"what-is-react\" style=\"position:relative;\"><a href=\"#what-is-react\" aria-label=\"what is react 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>What is React?</h2>\n<p>React is popular among progressive web app developers. This open-source, robust JavaScript library helps in building user interfaces based on UI components. React gains popularity in the software development industry because it allows developers to create lightweight apps with additional facilities: security, push notification, app-like look and feel, etc. Some popular companies that have become the early adopters of React are Instagram, Netflix, Airbnb, Uber Eats, Discord, the New York Times, etc. </p>\n<h2 id=\"security-vulnerabilities-in-react-and-how-to-prevent-them\" style=\"position:relative;\"><a href=\"#security-vulnerabilities-in-react-and-how-to-prevent-them\" aria-label=\"security vulnerabilities in react and how to prevent them 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>Security Vulnerabilities in React and How to Prevent Them</h2>\n<p>React helps developers build a reliable, robust, and secure progressive web app, but these apps face certain security pitfalls also. Developers need to give prior attention to security vulnerabilities, which are often ignored due to faster app development cycles or more focus on product features.\nWith the arrival of each new update in React having more features, the security flaws are getting unnoticed. Such unnoticed actions are increasing security concerns. Here is a list of top React security vulnerabilities that every React developer must address before delivering or deploying their apps.</p>\n<h2 id=\"sql-injection\" style=\"position:relative;\"><a href=\"#sql-injection\" aria-label=\"sql injection 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>SQL Injection</h2>\n<p>SQL Injection (SQLi) is a widely known web application attack. The cybercriminal intends to perform database manipulation logically to access sensitive information that is not supposed to be displayed. Attackers try to sneak into that sensitive information to collect phone numbers, payment details, addresses, passwords, and other credentials.\nThis technique allows the attackers to manage access to the server, pull the data, and manipulate the values in the database. Apart from data modification, hackers can also delete the data.\nLet us take an example. Let us take an example where the code will search for the current user-ID and the login matching the employee name, where the owner is the current user-ID.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">string query = &quot;SELECT * FROM logondata WHERE owner = &quot;&#39;&quot;</span>\n<span class=\"grvsc-line\">+ empID + &quot;&#39; AND empName = &#39;&quot;</span>\n<span class=\"grvsc-line\">+ EmpName.Text + &quot;&#39;&quot;;</span></code></pre>\n<p>Combining both the employee ID and employee name, the following query gets generated.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">SELECT * FROM logondata</span>\n<span class=\"grvsc-line\">WHERE owner =</span>\n<span class=\"grvsc-line\">AND empName = ;</span></code></pre>\n<p>The problem that pops here is that the main code leverages the concept of concatenation that helps in combining those data. The attacker can use a string like <code> 'empName' OR 'x'='x' </code> as the employee name. <code> 'x' = 'x' </code> is such a condition, which will always evaluates to True. Therefore, the statement returns True for all values within the table. So, the following query becomes:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">SELECT * FROM logondata</span>\n<span class=\"grvsc-line\">WHERE owner = &#39;karlos&#39;</span>\n<span class=\"grvsc-line\">AND empName = &#39;name&#39; OR &#39;x&#39; = &#39;x&#39;;</span></code></pre>\n<p>There are three major categories of SQL injection based on how attackers gain access to the backend data.</p>\n<ul>\n<li>\n<p><strong>In-band SQL Injection:</strong> Here the persuader will instigate the attack and gather sensitive credentials via one single channel. Such SQL attacks are simple, and hence, it is one of the most commonly performed SQLi attacks on React apps. It comes with two sub-categories –</p>\n<ul>\n<li><strong>Error-based SQLi:</strong> The attacker performs a fake mimicking of the admin's credentials. Such an action provokes the database to generate an error. This error message reflects how the database schema and its structure got designed.</li>\n<li><strong>Union-based SQLi:</strong> The attacker uses the UNION operator of SQL to perform this attack. Using UNION, the attacker fuses multiple SELECT statements and triggers them from the web app for an HTTP response. Attackers can conduct a successful attack if the data response fetches some sensitive data residing in the database. It proves that UNION-based SQLi is possible.</li>\n</ul>\n</li>\n<li>\n<p><strong>Inferential/Blind SQL Injection:</strong> The attacker pushes payloads targeting the server. Then they observe the behavior and keep track of the server response to know more about the database structure. Here, the attacker cannot witness the data reverting through the attack in-band, hence the name \"Blind.\" There are two sub-categories of blind SQLi.</p>\n<ul>\n<li><strong>Boolean:</strong> The persuader sends an adversary query to the target database initiating the app to respond back. Depending on the True or False response value, the cybercriminal can prepare another SQL query that can extract data from that target database. The result of the query is either True or False and hence the name.</li>\n<li><strong>Time-based:</strong> Here, the attacker sends a SQL query through the web app and waits for the response. The attacker records the time required by the database in responding back and checks the server response as well (True or False). Based on these two response parameters, the attacker re-launches another query. If the message sent through the SQL query successfully slows down the response, SQL injection is possible on that application.</li>\n</ul>\n</li>\n<li><strong>Out-of-Band SQL Injection:</strong> Such attacks are more likely when the attacker senses some particular feature enabled in the server used by the React web application. This attack happens when the attacker cannot use the same channel to launch the attack and fetch data. They use such attack vectors when the server is unstable or unable to respond promptly.</li>\n</ul>\n<h3 id=\"checklist-to-fix-sqli-vulnerability-in-react-apps\" style=\"position:relative;\"><a href=\"#checklist-to-fix-sqli-vulnerability-in-react-apps\" aria-label=\"checklist to fix sqli vulnerability in react apps 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>Checklist to Fix SQLi Vulnerability in React Apps</h3>\n<ul>\n<li>A developer must follow the principle of rendering the least privilege to all accounts that will connect through a SQL query to the database.</li>\n<li>It is always necessary to filter all sorts of user input by following a strict whitelist. Even when an internal user provides any SQL query as input, the React app should filter those incoming SQL queries.</li>\n<li>A progressive web app becomes a victim of SQLi when a developer gives its database connection access to privileges like INSERT, UPDATE, or DELETE. So, developers should follow the best practice by assigning accurate database roles to separate account types.</li>\n<li>There could be some external factors (such as an external library, API, or software) that might drag your React application to a vulnerable position. To protect your React app from such vulnerability, the development team should scan the app periodically through any vulnerability scanner like Nessus or Acunetix.</li>\n<li>APIs connected to the React app can pose a threat to a significant level. Thus, a robust approach to avoid SQLi on React apps is to verify all API functions associated with their API schemas.</li>\n<li>Developers can place a REST API between the front-end (React code) and the back-end (database). It will create an extra layer of security that will not allow the front-end users to execute any SQL query directly. It prevents the React app from SQL injection attacks.</li>\n</ul>\n<h2 id=\"cross-site-scripting-xss-vulnerabilities\" style=\"position:relative;\"><a href=\"#cross-site-scripting-xss-vulnerabilities\" aria-label=\"cross site scripting xss vulnerabilities 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>Cross-Site Scripting (XSS) Vulnerabilities</h2>\n<p>The comprehensive rendering feature of React makes it a preferable choice over other JavaScript libraries and frameworks. But this rendering feature also drags React-based apps to the most widely exploited vulnerability, cross-site scripting (XSS). Cross-site scripting leverages malicious client-side scripts by injecting them into web applications. When the users trigger those scripts, the attackers gain control over the app and steal sensitive information from the web application. </p>\n<p>Injecting malicious scripts into the react app will make the app release some internal app data. Therefore, React developers should prevent the application from running the script. Here is a typical example of cross-site scripting where the attacker can place and execute a malicious script within the application like this:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;input type=&quot;search&quot; value=&quot;PWA&quot;/&gt;</span></code></pre>\n<p>Now, executing malicious script will make the search look like:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;input type=&quot;search&quot; value=&quot;Attacker &quot;/&gt; &lt;script&gt; StealCredentials() &lt;/script&gt;&quot;&gt; ;</span></code></pre>\n<p>Here, StealCredentials() is a function that contains malicious scripts to steal user information.\nLet us now take a look at the types of XSS.</p>\n<ul>\n<li><strong>Reflected (Non-persistent) XSS:</strong> In this common type of XSS invasion, the attacker pushes phishing emails, malicious links or uses different hacking techniques to outwit victims to send malicious requests to the server. So, if the application is not leveraging a decent escaping method to user-provided data, the reflected XSS payload gets executed to the user's browser.</li>\n<li><strong>Stored (Persistent) XSS:</strong> It is the most damaging XSS attack form that stores the payload somewhere on the server-side. The attacker uses that payload or malicious script (mostly a JavaScript code) into the target React application. If the application does not render any input validation, the malicious code gets stored permanently (persistent) within the database. Popular web application areas where attackers try this attack are in the blog comment box or a forum post.</li>\n<li><strong>DOM-based XSS:</strong> Attackers can implement such XSS invasion when the web application follows the Document Object Model (DOM) structure. A progressive web app leveraging the principle of DOM stores the data on the client-side. The browser has to read and display the output from that stored data. In DOM-based XSS, the attacker injects the malicious code or payload in the DOM and hence the name. The attack mechanism executes the injected payload when users read the data back from the DOM.</li>\n</ul>\n<h3 id=\"checklist-to-fix-xss-vulnerability-in-react-apps\" style=\"position:relative;\"><a href=\"#checklist-to-fix-xss-vulnerability-in-react-apps\" aria-label=\"checklist to fix xss vulnerability in react apps 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>Checklist to Fix XSS Vulnerability in React Apps</h3>\n<p>This attack gains popularity, not simply because of its potential to harm the target users through the application but because such attacks need more creative and intellectual hackers. But, to prevent such attacks, developers need to become even more creative.</p>\n<ul>\n<li>The easiest way of securing any React app from multiple XSS attacks is to employ WAF (Web Application Firewall) with the code. WAF leverages a concept called signature-based filtering to restrict cross-site scripting attacks. React developers can incorporate a web application firewall into their code for protecting the app from running any adversary script.</li>\n<li>Developers can also disable the markups through which attackers can perform external code execution on React app. Some well-known HTML elements that allow running scripts are: &#x3C;script>, &#x3C;link>, &#x3C;object>, and &#x3C;embed>.</li>\n<li>Various programming languages offer libraries that can enable parsing HTML formatted text. These libraries can help sanitize HTML markup easily to prevent React apps from XSS. OWASP also has a range of libraries such as HtmlSanitizer, Java HTML Sanitizer, etc.</li>\n<li>Developers can also protect React apps from XSS by performing blacklist validation in conjunction with URL parsing.</li>\n<li>Modern and updated browsers (like Google Chrome) come with XSS detection and will not allow attackers to run any malicious script that is not coming from the original server or source.</li>\n<li>React developers can also prevent XSS by adding one security check by leveraging <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\">Cross-Origin Resource Sharing (CORS)</a>. They have to use it in the code header and assign it 'True'. It uses the browser's same-origin policy and blocks reading a resource originating from a different origin. Using CORS, developers can stop a malicious site from reading another site's data.</li>\n<li>\n<p>You can also use content security policies as the last line of defense against XSS. If all other XSS prevention fails, CSP allows developers to control various things, such as loading external scripts and executing inline scripts. To deploy CSP, developers need to include an HTTP response header called Content-Security-Policy with a value carrying the policy.\nAn example for including CSP is as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">default-src &#39;self&#39;; script-src &#39;self&#39;; object-src &#39;none&#39;; frame-src &#39;none&#39;; base-uri &#39;none&#39;;</span></code></pre>\n</li>\n</ul>\n<h2 id=\"broken-authentication\" style=\"position:relative;\"><a href=\"#broken-authentication\" aria-label=\"broken authentication 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>Broken Authentication</h2>\n<p>Broken authentication is a weakness through which attackers can capture one or multiple accounts when authentication or session management is poorly implemented in progressive web apps. This vulnerability helps the attacker take over multiple user accounts, letting the attacker possess the same privileges and access control as the target user. </p>\n<p>Attackers usually exploit such a React security vulnerability by detecting the authentication solution or bypassing them. The security team labels the authentication as broken when the cybercriminal can compromise users' passwords, session tokens, digital identities, or account information from the React app. Examples of some common reasons for this attack are:</p>\n<ul>\n<li>Unencrypted network sending session IDs, passwords, and other credentials</li>\n<li>Unprotected authentication credentials</li>\n<li>Session values without a specific time-out</li>\n<li>Predictable login credentials</li>\n<li>Improper hashing and salting of passwords</li>\n</ul>\n<p>Let us take a situation where the attacker could detect the hashes for the following names.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Sue    4420d1918bbcf7686defdf9560bb5087d20076de5f77b7cb4c3b40bf46ec428s</span>\n<span class=\"grvsc-line\">Karlos    4420d1918bbcf7686defdf9560bb5087d20076de5f77b7cb4c3b40bf46ec624g</span>\n<span class=\"grvsc-line\">Dee    77b177de23f81d37b5b4495046b227befa4546db63cfe6fe541fc4c3cd216egk</span></code></pre>\n<p>The hash function will store the password in a hashed form rather than plain text. But then, humans can easily read the hash. Now, if two different users enter the same password, then these passwords will generate the same hash. Hackers can perform a dictionary attack, and if they crack one password, they can use the same password to gain access to other accounts that use the same hash.</p>\n<h3 id=\"checklist-to-fix-react-pwas-from-broken-authentication-vulnerability\" style=\"position:relative;\"><a href=\"#checklist-to-fix-react-pwas-from-broken-authentication-vulnerability\" aria-label=\"checklist to fix react pwas from broken authentication vulnerability 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>Checklist to Fix React PWAs from Broken Authentication Vulnerability</h3>\n<ul>\n<li>The React applications should enforce password checks, whether the password is strong or weak. Also, adding criteria like eight characters (minimum) having uppercase, lowercase, numbers, and symbols can prevent users from such attacks.</li>\n<li>Employing multi-factor authentication (MFA) can prevent users from compromised credential reuse and credential stuffing.</li>\n<li>Another common React security best practice is to generate the message or notification email, keeping the email format or template the same. Such a practice prevents React app users from account enumeration attacks.</li>\n<li>Not exposing the session ID in the URL also comes under the best practice.</li>\n<li>For every React app, the session ID time-out is a must. Developers can secure progressive web apps by implementing a server-side session manager. It will produce a new session every time the user tries to log in.</li>\n<li>Proper hashing and salting of passwords are mandatory to prevent broken authentication attacks.</li>\n</ul>\n<h2 id=\"xml-external-entities-xxe\" style=\"position:relative;\"><a href=\"#xml-external-entities-xxe\" aria-label=\"xml external entities xxe 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>XML External Entities (XXE)</h2>\n<p>Attackers can perform XML External Entities attacks on React web applications that parse XML input. Here the outdated XML parsers of your React app become vulnerable. Such vulnerability can lead an attacker to perform denial of service, port scanning, server-side request forgery, etc. Such attacks occur when an XML input gets referred to an external entity but has a weakly configured XML parser. Here are some examples where attackers are attempting XEE on React web applications that parse XML input.</p>\n<ul>\n<li>\n<p>The attacker might attempt to extract data from the server.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt; &lt;!DOCTYPE sample [</span>\n<span class=\"grvsc-line\">&lt;!ELEMENT sample POO &gt;</span>\n<span class=\"grvsc-line\">&lt;!ENTITY xmlxxe SYSTEM &quot;file:///etc/passwd&quot; &gt;]&gt; &lt;sample&gt; &xmlxxe; &lt;/sample&gt;</span></code></pre>\n</li>\n<li>\n<p>Another code snippet where the attacker explores the private network of the server by tweaking the code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;!ENTITY xmlxxe SYSTEM &quot;https://186.141.2.1/privnw&quot; &gt;]&gt;</span></code></pre>\n</li>\n<li>\n<p>It is another code snippet where the attacker tries for a Denial of Service (DoS) attack by comprising a potentially perpetual file:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;!ENTITY xmlxxe SYSTEM &quot;file:///gkr/rand&quot; &gt;]&gt;</span></code></pre>\n</li>\n</ul>\n<h3 id=\"checklist-to-fix-xxe-vulnerability-in-react-apps\" style=\"position:relative;\"><a href=\"#checklist-to-fix-xxe-vulnerability-in-react-apps\" aria-label=\"checklist to fix xxe vulnerability in react apps 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>Checklist to Fix XXE Vulnerability in React Apps</h3>\n<ul>\n<li>Developers need to keep all the XML libraries and processors fully updated or patched.</li>\n<li>It is a good practice to disable all XML external entities and DTD processing.</li>\n<li>React developers should adopt simpler data formats like JSON instead of XML. It will help avoid the serialization of sensitive data.</li>\n<li>Various Static Application Security Testing (SAST) tools help identify malicious XXE in the code.</li>\n<li>Developers should also perform filtering and server-side input validation to limit injecting unfriendly data input in XML documents or headers. Modern and updated browsers do not allow attackers to run malicious XML scripts as they come with built-in input validation.</li>\n</ul>\n<h2 id=\"zip-slip\" style=\"position:relative;\"><a href=\"#zip-slip\" aria-label=\"zip slip 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>Zip Slip</h2>\n<p>It is another popular React app vulnerability where the malicious actor exploits the app by submitting zip files having malicious or arbitrary code within them. React developers enable adding zip files to decrease the file size while they get uploaded. When the app unzips the archive, its malicious file(s) can overwrite other files or perform arbitrary code execution. Attackers can either harm the files existing in the target system or gain remote access to the system.</p>\n<p>Here is a Zip slip code example demonstrating a ZipEntry path merges to a destination directory without validating that path. Researchers and security professionals have found similar codes in different repositories across many apps.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Enumeration&lt;ZipEntry&gt; entry = zip.getEntries();</span>\n<span class=\"grvsc-line\"> while (entry.hasMoreElements()) {</span>\n<span class=\"grvsc-line\">ZipEntry ez = entry.nextElement();</span>\n<span class=\"grvsc-line\">File fil = new File(destinationDir, ez.getName());</span>\n<span class=\"grvsc-line\">InputStream input = zip.getInputStream(ez);</span>\n<span class=\"grvsc-line\">IOUtils.copy(input, write(fil));</span>\n<span class=\"grvsc-line\"> }</span></code></pre>\n<p>Here is a <a href=\"https://github.com/snyk/zip-slip-vulnerability\">link</a> to the repository containing libraries and APIs infected by zip slip.</p>\n<h3 id=\"checklist-to-fix-zip-slip-vulnerability-in-react-apps\" style=\"position:relative;\"><a href=\"#checklist-to-fix-zip-slip-vulnerability-in-react-apps\" aria-label=\"checklist to fix zip slip vulnerability in react apps 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>Checklist to Fix Zip Slip Vulnerability in React Apps</h3>\n<ul>\n<li>React developers can search through the project for vulnerable codes. Developers can integrate validation code to the original application's code to check for directory traversal.</li>\n<li>Another way to prevent Zip Slip attacks in React apps is to include the Zip Slip Security Testing solution in the build pipeline of the app.</li>\n<li>Do not allow uploading files having special characters.</li>\n<li>Renaming all the zip files is another best practice to prevent zip slip attacks. Developers should generate new file names for each file before the application leverages them.</li>\n<li>Node.js uses npm libraries as the dependency. React internally uses node.js, and hence any vulnerable library can pose a threat to the React app. It is a good practice to create your own dependencies and libraries rather than using 3rd-party libraries.</li>\n</ul>\n<h2 id=\"cross-site-request-forgery-csrf-or-xsrf\" style=\"position:relative;\"><a href=\"#cross-site-request-forgery-csrf-or-xsrf\" aria-label=\"cross site request forgery csrf or xsrf 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>Cross-site Request Forgery (CSRF or XSRF)</h2>\n<p>CSRF is another React web application vulnerability allowing attackers to persuade users to perform unintentional actions without their direct consent. It does not steal the identity of the legitimate user but acts against their will. For rendering such attacks, the attacker sends an email or a web link convincing the victim to achieve a state-changing request in the application.</p>\n<p>Before going through the checklist on fixing CSRF vulnerabilities, here is a quick example of how the CSRF GET request will be once the attacker tweaks it.\nA standard GET request for a $250 transfer from person1 to person2 might look like this:</p>\n<p>When the attacker induces the user to perform some unintended action or runs a malicious script, the $250 gets transferred to the attacker's account. This malicious request might look something like this:</p>\n<p>Some attackers can also put innocent-looking hyperlinks embedding the request.</p>\n<h3 id=\"checklist-to-fix-react-pwas-from-csrf-vulnerability\" style=\"position:relative;\"><a href=\"#checklist-to-fix-react-pwas-from-csrf-vulnerability\" aria-label=\"checklist to fix react pwas from csrf vulnerability 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>Checklist to Fix React PWAs from CSRF Vulnerability</h3>\n<ul>\n<li>The progressive React web app should not deliver CSRF tokens using Cookies.</li>\n<li>An alternate defense mechanism against CSRF is to leverage a double submit cookie technique.</li>\n<li>Another robust way of preventing an application from a CSRF attack is to add a relevant CSRF token tied to user sessions and strictly validate every case before executing any appropriate action.</li>\n<li>It is always a good choice to shift from HTTP/1.1 to HTTP/2 or HTTP/3. HTTP/2 and 3 are fast, more secure than HTTP/1.1, and almost all modern browsers support them.</li>\n</ul>\n<h2 id=\"vulnerability-in-packages-and-dependencies\" style=\"position:relative;\"><a href=\"#vulnerability-in-packages-and-dependencies\" aria-label=\"vulnerability in packages and dependencies 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>Vulnerability in Packages and Dependencies</h2>\n<p>It might happen that you have pushed a React app's code to GitHub. Now an email/notification is popping up saying, \"One of your dependencies has a security vulnerability.\" That is another method where attackers seek the help of malicious packages to gain access to your React applications. Such malicious packages collect valuable app details and user information and send it to a third party. </p>\n<p>These packages can also execute malicious code during the package installation phase. These attackers use the concept of typosquatting to make their attacks seamless. Typosquatting is a method of naming the packages based on their original counterparts. It outwits the developers into downloading these malicious packages that can wreak havoc on the React app.</p>\n<h3 id=\"checklist-to-fix-malicious-package-vulnerability-in-react-apps\" style=\"position:relative;\"><a href=\"#checklist-to-fix-malicious-package-vulnerability-in-react-apps\" aria-label=\"checklist to fix malicious package vulnerability in react apps 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>Checklist to Fix Malicious Package Vulnerability in React Apps</h3>\n<ul>\n<li>One way to detect and remove this vulnerability is to recognize the vulnerable package and find an alternative React package. It is a good practice to analyze your app against malicious package vulnerability.</li>\n<li>Developers can also use SAST tools to detect exploitable code in a React application. SAST tools can scan and inspect all the application's source code, byte code, dependencies, packages, and binaries to uncover security vulnerabilities.</li>\n<li>Since Node uses npm libraries and dependencies and React uses Node, developers should make a checklist of vulnerable libraries like <a href=\"https://github.com/ZJONSSON/node-unzipper\">unzipper</a>, <a href=\"https://github.com/cthackers/adm-zip\">adm-zip</a>, and <a href=\"https://snyk.io/vuln/npm:npm\">other vulnerability release lists</a> for better precaution while developing React applications. </li>\n</ul>\n<h2 id=\"wrapping-up\" style=\"position:relative;\"><a href=\"#wrapping-up\" aria-label=\"wrapping up 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>Wrapping Up</h2>\n<p>Hope this comprehension has given a crisp idea of the top React vulnerabilities and the different checklists developers can use to fix those security flaws. Developers should know how crucial application security is for both the business and its users. As the React features are increasing, there is an equal delay in the number of days taken by the React community to fix any React security issues. </p>\n<p>In this article, we discussed the most well-known vulnerabilities like SQLi, XSS, Broken Authentication, XXE, Zip Slip, CSRF, and Package &#x26; dependency vulnerabilities, plus how to prevent React apps from such attacks. So, developers and product managers should cautiously handle all security-related aspects of a React project by following the checklist given in this article.</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":"December 24, 2021","updated_date":null,"description":"React security vulnerabilities are hard to detect. However, this article talks about the top 7 vulnerabilities and how to fix them to enjoy all the benefits React caters to in developing Progressive Web Applications.","title":"React Security Vulnerabilities and How to Fix/Prevent Them","tags":["React","Vulnerability"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.2820512820512822,"src":"/static/9bd496853e1dfc053e95fe44dbb19cc7/58556/react-security.webp","srcSet":"/static/9bd496853e1dfc053e95fe44dbb19cc7/61e93/react-security.webp 200w,\n/static/9bd496853e1dfc053e95fe44dbb19cc7/1f5c5/react-security.webp 400w,\n/static/9bd496853e1dfc053e95fe44dbb19cc7/58556/react-security.webp 800w,\n/static/9bd496853e1dfc053e95fe44dbb19cc7/99238/react-security.webp 1200w,\n/static/9bd496853e1dfc053e95fe44dbb19cc7/7c22d/react-security.webp 1600w,\n/static/9bd496853e1dfc053e95fe44dbb19cc7/24dd2/react-security.webp 1926w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Gaurav Kumar Roy","github":"GauravRoy6","avatar":null}}}},{"node":{"excerpt":"Security has become a fundamental aspect to consider while developing an application. As people become more aware and hackers more notorious…","fields":{"slug":"/engineering/guest-post/securing-php-api-with-jwt/"},"html":"<p>Security has become a fundamental aspect to consider while developing an application. As people become more aware and hackers more notorious, you need to employ systems that strengthen your application's data security.</p>\n<p>Previously, it was common to use session storage to secure applications. In recent times, sessions have proved inefficient, which pushed to migrate to authentication with APIs. Even though this was a superb and robust way to secure web applications, it became obsolete as hackers tried to figure out how to crack this authentication.</p>\n<p>As the web evolves to accept more and more users, the research for secure authentication techniques speeds up. In 2010, the world was introduced to a new and secure authentication standard -- JWT. Let's know more about JWT.</p>\n<h2 id=\"what-is-jwt\" style=\"position:relative;\"><a href=\"#what-is-jwt\" aria-label=\"what is jwt 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>What is JWT?</h2>\n<p>JSON Web Token (JWT) is a safe way to authenticate users on a web app. Using JWT, you can securely transfer encrypted data and information between a client computer and a server.</p>\n<blockquote>\n<p>Learn more about the <a href=\"https://www.loginradius.com/blog/engineering/guest-post/jwt-vs-sessions/\">differences between sessions and JWTs here</a>.</p>\n</blockquote>\n<p>JWT offers many benefits. Here are some of them.</p>\n<h2 id=\"benefits-of-using-jwt\" style=\"position:relative;\"><a href=\"#benefits-of-using-jwt\" aria-label=\"benefits of using jwt 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>Benefits of Using JWT</h2>\n<ul>\n<li>Compatible with OAuth 2, meaning your applications will be easy to work with the latest security standards.</li>\n<li>JWTs can expire after some time so that no one has uninterrupted access to the website. This is important to protect a website from attacks.</li>\n<li>JSON is used to transmit data, so you can work with any language of your choice and handle the JSON data.</li>\n<li>JWTs are feature-rich and encompass complete information about any authorization request with different aspects.</li>\n</ul>\n<p>Now that you've learned about the advantages, it's time to go deeper into the JWT.</p>\n<h2 id=\"the-structure-of-jwt\" style=\"position:relative;\"><a href=\"#the-structure-of-jwt\" aria-label=\"the structure of jwt 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>The Structure of JWT</h2>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">eyJ</span><span class=\"mtk7\">0</span><span class=\"mtk1\">eXAiOiJKV</span><span class=\"mtk7\">1</span><span class=\"mtk1\">QiLCJhbGciOiJIUzI</span><span class=\"mtk7\">1</span><span class=\"mtk1\">NiJ</span><span class=\"mtk7\">9</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .eyJpc</span><span class=\"mtk7\">3</span><span class=\"mtk1\">MiOiJodHRwczpcL</span><span class=\"mtk7\">1</span><span class=\"mtk1\">wvcWEtYXBpLndlbGx</span><span class=\"mtk7\">2</span><span class=\"mtk1\">aWJlLmNvbVwvYXBpXC</span><span class=\"mtk7\">9</span><span class=\"mtk1\">hdXRoXC</span><span class=\"mtk7\">9</span><span class=\"mtk1\">sb</span><span class=\"mtk7\">2</span><span class=\"mtk1\">dpbiIsImlhdCI</span><span class=\"mtk7\">6</span><span class=\"mtk1\">MTYzMDQ</span><span class=\"mtk7\">3</span><span class=\"mtk1\">OTA</span><span class=\"mtk7\">5</span><span class=\"mtk1\">NSwiZXhwIjoxNjMwNDgyNjk</span><span class=\"mtk7\">1</span><span class=\"mtk1\">LCJuYmYiOjE</span><span class=\"mtk7\">2</span><span class=\"mtk1\">MzA</span><span class=\"mtk7\">0</span><span class=\"mtk1\">NzkwOTUsImp</span><span class=\"mtk7\">0</span><span class=\"mtk1\">aSI</span><span class=\"mtk7\">6</span><span class=\"mtk1\">Imtsa</span><span class=\"mtk7\">3</span><span class=\"mtk1\">hHUGpMOVlNTzRSdUsiLCJzdWIiOjc</span><span class=\"mtk7\">3</span><span class=\"mtk1\">ODE</span><span class=\"mtk7\">4</span><span class=\"mtk1\">LCJwcnYiOiIyM</span><span class=\"mtk7\">2</span><span class=\"mtk1\">JkNWM</span><span class=\"mtk7\">4</span><span class=\"mtk1\">OTQ</span><span class=\"mtk7\">5</span><span class=\"mtk1\">ZjYwMGFkYjM</span><span class=\"mtk7\">5</span><span class=\"mtk1\">ZTcwMWM</span><span class=\"mtk7\">0</span><span class=\"mtk1\">MDA</span><span class=\"mtk7\">4</span><span class=\"mtk1\">NzJkYjdhNTk</span><span class=\"mtk7\">3</span><span class=\"mtk1\">NmY</span><span class=\"mtk7\">3</span><span class=\"mtk1\">IiwidXNlcnNfaWQiOjc</span><span class=\"mtk7\">3</span><span class=\"mtk1\">ODE</span><span class=\"mtk7\">4</span><span class=\"mtk1\">LCJtZW</span><span class=\"mtk7\">1</span><span class=\"mtk1\">iZXJzX</span><span class=\"mtk7\">2</span><span class=\"mtk1\">lkIjo</span><span class=\"mtk7\">3</span><span class=\"mtk1\">Nzg</span><span class=\"mtk7\">4</span><span class=\"mtk1\">MzMsInByb</span><span class=\"mtk7\">3</span><span class=\"mtk1\">h</span><span class=\"mtk7\">5</span><span class=\"mtk1\">X</span><span class=\"mtk7\">3</span><span class=\"mtk1\">VzZXJfbWVtYmVyc</span><span class=\"mtk7\">19</span><span class=\"mtk1\">pZCI</span><span class=\"mtk7\">6</span><span class=\"mtk1\">bnVsbH</span><span class=\"mtk7\">0</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  .TxXwLLu</span><span class=\"mtk7\">1</span><span class=\"mtk1\">zWBe</span><span class=\"mtk7\">7</span><span class=\"mtk1\">cLLYdFYy</span><span class=\"mtk7\">3</span><span class=\"mtk1\">P</span><span class=\"mtk7\">2</span><span class=\"mtk1\">HX</span><span class=\"mtk7\">4</span><span class=\"mtk1\">AaLgc</span><span class=\"mtk7\">7</span><span class=\"mtk1\">WfSRtTgeiI</span></span></code></pre>\n<p>The above string is an example of a JWT authentication string. At first glance, it may appear to be a randomly produced string. But don't underestimate; this string is made up of three separate components that are essential in a JWT.</p>\n<h3 id=\"jwt-header\" style=\"position:relative;\"><a href=\"#jwt-header\" aria-label=\"jwt header 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>JWT Header</h3>\n<p>The header of a JWT is the initial section of the string before the first dot. This header is produced by acquiring plain text and performing cryptographic operations on it. Moreover, the header uses a very efficient Base64 encoding procedure.</p>\n<p>You can quickly obtain the JWT's headers using symmetric or asymmetric encryption techniques.</p>\n<h3 id=\"jwt-payload\" style=\"position:relative;\"><a href=\"#jwt-payload\" aria-label=\"jwt payload 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>JWT Payload</h3>\n<p>The string's central component is the JWT's payload part. This string includes all of the important information about a received request and the user or client computer who created the request. There are predefined key-value pair fields in the payload that can be used to offer extra information about the received request. Here is an explanation of common payload fields.</p>\n<ul>\n<li><strong>Sub</strong> - The sub field contains the subject of a JWT payload. It contains unique information about the user and client device that has created this authentication request.</li>\n<li><strong>Iss</strong> - This field contains data about the server that has issued the token. Iss is short for Issuer, which refers to the server.</li>\n<li><strong>Exp</strong> - Unlike other authentication techniques, JWT has an expiration time. This field's name is a short form for the expiration date. It contains data about when the token was issued and the expiration date and time of the issued token.</li>\n</ul>\n<h3 id=\"jwt-signature\" style=\"position:relative;\"><a href=\"#jwt-signature\" aria-label=\"jwt signature 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>JWT Signature</h3>\n<p>A cryptographic operation is performed on the JWT data to obtain this signature. It takes in the payload, secret key, and header value of a JWT. The signature is then generated by applying a function to these obtained values.</p>\n<p>The server and user can verify this signature to know about the data's security and integrity. If this signature matches at both ends, then the data is considered secure, and all other transactions can occur.</p>\n<h2 id=\"using-jwts-to-secure-php-api\" style=\"position:relative;\"><a href=\"#using-jwts-to-secure-php-api\" aria-label=\"using jwts to secure php 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>Using JWTs to Secure PHP API</h2>\n<p>As you've understood everything about JWT, let's secure your PHP API using JWT. Follow the code along, and, in the end, you'll create a tamper-proof PHP API.</p>\n<p>This article creates a simple login page and authenticates it using JWT. This will help you get started with JWT and PHP.</p>\n<p>To follow along, you'll need to have PHP and composer installed on your computer.</p>\n<p>If you haven't already installed composer on your computer, you can <a href=\"https://getcomposer.org/doc/00-intro.md\">learn how to install composer here</a>. Once you've installed composer, run the tool from your project folder. Composer will assist you in installing Firebase PHP-JWT, a third-party library for working with JWTs and Apache.</p>\n<p>Once the library is installed, you'll need to set up a login code in <code>authenticate.php</code>. While you do this, put a code piece that checks and gets the autoloader from the composer tool. The below code helps you achieve this.</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=\"mtk1\">&lt;?php</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">declare</span><span class=\"mtk1\">(strict_types=</span><span class=\"mtk7\">1</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">use</span><span class=\"mtk1\"> Firebase\\JWT\\</span><span class=\"mtk10\">JWT</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">require_once</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;../vendor/autoload.php&#39;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>When the form gets submitted, you need to check the entered data with a data source or database. For our purpose, let's create a <code>hasValidCredentials</code> variable and set it to true. Setting this variable to true means that the data is checked and valid.</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=\"mtk1\">&lt;?php</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// extract credentials from the request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">$hasValidCredentials</span><span class=\"mtk1\">) {</span></span></code></pre>\n<p>Any further coding will be wrapped in this block itself. The value of the <code>hasValidCredentials</code> variable governs all code related to the production and validation of the required JWT. If its value is true, the JWT shall be created; otherwise, an error will be shown.</p>\n<h3 id=\"creating-jwt\" style=\"position:relative;\"><a href=\"#creating-jwt\" aria-label=\"creating jwt 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>Creating JWT</h3>\n<p>Let's start creating the JWT. First, you need to generate some more variables to aid in this process. As you saw in the payload section, you must create:</p>\n<ul>\n<li>a variable that will hold the secret key, which may be retrieved from the environment files;</li>\n<li>another variable to hold information about when the JWT was created;</li>\n<li>a variable that will hold the JWT's expiration date and time;</li>\n<li>a username field to identify the client making the authorization request; and,</li>\n<li>a server name variable to register the server name.</li>\n</ul>\n<p>JWT's can be easily inspected and checked at client-side browsers. So it is better to hide your secret key and other important information in some environment file, which the user cannot access through client-side requests.</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=\"mtk12\">$secret_Key</span><span class=\"mtk1\">  = </span><span class=\"mtk8\">&#39;68V0zWFrS72GbpPreidkQFLfj4v9m3Ti+DXc8OB0gcM=&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$date</span><span class=\"mtk1\">   = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">DateTimeImmutable</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$expire_at</span><span class=\"mtk1\">     = </span><span class=\"mtk12\">$date</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk11\">modify</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;+6 minutes&#39;</span><span class=\"mtk1\">)-&gt;</span><span class=\"mtk11\">getTimestamp</span><span class=\"mtk1\">();      </span><span class=\"mtk3\">// Add 60 seconds</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$domainName</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;your.domain.name&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$username</span><span class=\"mtk1\">   = </span><span class=\"mtk8\">&quot;username&quot;</span><span class=\"mtk1\">;                                           </span><span class=\"mtk3\">// Retrieved from filtered POST data</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$request_data</span><span class=\"mtk1\"> = [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&#39;iat&#39;</span><span class=\"mtk1\">  =&gt; </span><span class=\"mtk12\">$date</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk11\">getTimestamp</span><span class=\"mtk1\">(),         </span><span class=\"mtk3\">// Issued at: time when the token was generated</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&#39;iss&#39;</span><span class=\"mtk1\">  =&gt; </span><span class=\"mtk12\">$domainName</span><span class=\"mtk1\">,                       </span><span class=\"mtk3\">// Issuer</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&#39;nbf&#39;</span><span class=\"mtk1\">  =&gt; </span><span class=\"mtk12\">$date</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk11\">getTimestamp</span><span class=\"mtk1\">(),         </span><span class=\"mtk3\">// Not before</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&#39;exp&#39;</span><span class=\"mtk1\">  =&gt; </span><span class=\"mtk12\">$expire_at</span><span class=\"mtk1\">,                           </span><span class=\"mtk3\">// Expire</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&#39;userName&#39;</span><span class=\"mtk1\"> =&gt; </span><span class=\"mtk12\">$username</span><span class=\"mtk1\">,                     </span><span class=\"mtk3\">// User name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">];</span></span></code></pre>\n<p>Now you have all the required data in hand; you can easily create a JWT. Here, you'll use the PHP-JWT package's <code>encode()</code> method. This method helps transform your data array into a JSON object.</p>\n<p>Following the conversion to a JSON object, the encode function produces JWT headers and signs the received payload with a cryptographic combination of all the information and the given secret key.</p>\n<p>It is essential to supply three arguments to the <code>encode()</code> method to utilize it correctly. The first argument should be the payload information, which is the data array in this instance. Secondly, you must supply the secret key as an argument; and finally, you must define the cryptographic technique that the function should use to sign the JWT.</p>\n<p>To obtain and return the JWT, you'll have to use the echo method above the encode method, as shown below.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;?php</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Encode the array to a JWT string.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">echo</span><span class=\"mtk1\"> </span><span class=\"mtk10\">JWT</span><span class=\"mtk1\">::</span><span class=\"mtk11\">encode</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">$request_data</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">$secret_Key</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&#39;HS512&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Now that you have obtained the JWT token, you can transfer it to the client-side and save it using any web programming language of your choice. Let's start with a short JS demonstration of the route ahead.</p>\n<p>First, when a successful form submission takes place, save the created and received JWT in client-side memory. To display some output about the JWT's success, remove the login form and merely display a button that retrieves and displays the JWT's timestamp to the user when it is clicked.</p>\n<p>Here is some sample code for the process mentioned above.</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\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">storeJWT</span><span class=\"mtk1\"> = {}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginBtn</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">querySelector</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#frmLogin&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">btnResource</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">querySelector</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#btnGetResource&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">formData</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk12\">forms</span><span class=\"mtk1\">[</span><span class=\"mtk7\">0</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Inserts the jwt to the store object</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">storeJWT</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setJWT</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">function</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=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">JWT</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">data</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">loginBtn</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;submit&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">preventDefault</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/authenticate.php&quot;</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">method:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;POST&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">headers:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;Content-type&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;application/x-www-form-urlencoded; charset=UTF-8&quot;</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 class=\"mtk12\">body:</span><span class=\"mtk1\"> </span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">username:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">formData</span><span class=\"mtk1\">.</span><span class=\"mtk12\">inputEmail</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">password:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">formData</span><span class=\"mtk1\">.</span><span class=\"mtk12\">inputPassword</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> &gt;= </span><span class=\"mtk7\">200</span><span class=\"mtk1\"> && </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> &lt;= </span><span class=\"mtk7\">299</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jwt</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">text</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">storeJWT</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setJWT</span><span class=\"mtk1\">(</span><span class=\"mtk12\">jwt</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">frmLogin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">style</span><span class=\"mtk1\">.</span><span class=\"mtk12\">display</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;none&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">btnResource</span><span class=\"mtk1\">.</span><span class=\"mtk12\">style</span><span class=\"mtk1\">.</span><span class=\"mtk12\">display</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;block&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  } </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Handle errors</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\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\">, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">statusText</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></code></pre>\n<p>You've already produced and submitted the JWT to the user. So now it's time to put the JWT to use on the user side.</p>\n<h3 id=\"using-jwt\" style=\"position:relative;\"><a href=\"#using-jwt\" aria-label=\"using jwt 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>Using JWT</h3>\n<p>As previously stated, if the form submission is successful, you'll display a button to obtain a timestamp. This button will invoke the GET method on the <code>resource.php</code> script. The <code>resource.php</code> script will then set the JWT received after successful authentication in the authentication header.</p>\n<p>The following code will help you achieve this feat.</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=\"mtk12\">btnResource</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;click&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">result</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/resource.php&quot;</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">headers:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">Authorization:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">`Bearer </span><span class=\"mtk4\">${</span><span class=\"mtk12\">storeJWT</span><span class=\"mtk1\">.</span><span class=\"mtk12\">JWT</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</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 class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">timeStamp</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">result</span><span class=\"mtk1\">.</span><span class=\"mtk11\">text</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\">timeStamp</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">})</span></span></code></pre>\n<p>Once you've written this code, run the program and enter your credentials into the form fields. A GET request will be sent when you click the submit button. Here is a sample GET request to assist you in making the correct identification.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">GET /resource.php HTTP/</span><span class=\"mtk7\">1.1</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Host: yourhost.com</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Connection: keep-alive</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Accept: *</span><span class=\"mtk3\">/*</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">X-Requested-With: XMLHttpRequest</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvcWEtYXBpLndlbGx2aWJlLmNvbVwvYXBpXC9hdXRoXC9sb2dpbiIsImlhdCI6MTYzMDQ3OTA5NSwiZXhwIjoxNjMwNDgyNjk1LCJuYmYiOjE2MzA0NzkwOTUsImp0aSI6Imtsa3hHUGpMOVlNTzRSdUsiLCJzdWIiOjc3ODE4LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3IiwidXNlcnNfaWQiOjc3ODE4LCJtZW1iZXJzX2lkIjo3Nzg4MzMsInByb3h5X3VzZXJfbWVtYmVyc19pZCI6bnVsbH0.TxXwLLu1zWBe7cLLYdFYy3P2HX4AaLgc7WfSRtTgeiI</span></span></code></pre>\n<h3 id=\"validating-jwt\" style=\"position:relative;\"><a href=\"#validating-jwt\" aria-label=\"validating jwt 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>Validating JWT</h3>\n<p>If you've followed along until here, everything should be working fine. Now, let's begin with validating the JWT.</p>\n<p>To get help with this operation, you've previously added the composer's autoloader function. You'll now use the <code>preg match</code> function to extract the token from the Bearer header. For this extraction, you'll use the <code>preg match</code> function and supply a regular expression.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (! </span><span class=\"mtk11\">preg_match</span><span class=\"mtk1\">(</span><span class=\"mtk5\">&#39;/Bearer</span><span class=\"mtk6\">\\s</span><span class=\"mtk5\">(</span><span class=\"mtk6\">\\S</span><span class=\"mtk1\">+</span><span class=\"mtk5\">)/&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">$_SERVER</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;HTTP_AUTHORIZATION&#39;</span><span class=\"mtk1\">], </span><span class=\"mtk12\">$matches</span><span class=\"mtk1\">)) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">header</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;HTTP/1.0 400 Bad Request&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">echo</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;Token not found in request&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">exit</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>The code above attempts to extract the token from the Bearer header. In this case, error handling is utilized. Thus if the token is not discovered, an HTTP 404 error is displayed to the user.</p>\n<p>To validate the JWT, you must first compare it to the previously created JWT.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">$jwt</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">$matches</span><span class=\"mtk1\">[</span><span class=\"mtk7\">1</span><span class=\"mtk1\">];</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (! </span><span class=\"mtk12\">$jwt</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// No token was able to be extracted from the authorization header</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">header</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;HTTP/1.0 400 Bad Request&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">exit</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>The extracted JWT is saved at the first index of the matches array. If the matching array is empty, it means no JWT was extracted. If the preceding code runs successfully, it implies that the JWT has been extracted, and you may now proceed.</p>\n<p>Decoding the received data is required for verifying a JWT. Only the secret key may be used to decode the received data. Once you've obtained the secret key, you may use the static decode function of the PHP-JWT module.</p>\n<p>The decode method requires three arguments, which are as follows.</p>\n<ul>\n<li>The JWT itself</li>\n<li>The secret key</li>\n<li>The algorithm to be used to decode the JWT</li>\n</ul>\n<p>If the decode method succeeds, you may proceed to validate the JWT. The code below will assist you in decoding and validating a JWT.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">$secret_Key</span><span class=\"mtk1\">  = </span><span class=\"mtk8\">&#39;68V0zWFrS72GbpPreidkQFLfj4v9m3Ti+DXc8OB0gcM=&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$token</span><span class=\"mtk1\"> = </span><span class=\"mtk10\">JWT</span><span class=\"mtk1\">::</span><span class=\"mtk11\">decode</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$jwt</span><span class=\"mtk1\">, </span><span class=\"mtk12\">$secret_Key</span><span class=\"mtk1\">, [</span><span class=\"mtk8\">&#39;HS512&#39;</span><span class=\"mtk1\">]);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$now</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">DateTimeImmutable</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$serverName</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;your.domain.name&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">$token</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk12\">iss</span><span class=\"mtk1\"> !== </span><span class=\"mtk12\">$serverName</span><span class=\"mtk1\"> ||</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$token</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk12\">nbf</span><span class=\"mtk1\"> &gt; </span><span class=\"mtk12\">$now</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk11\">getTimestamp</span><span class=\"mtk1\">() ||</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$token</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk12\">exp</span><span class=\"mtk1\"> &lt; </span><span class=\"mtk12\">$now</span><span class=\"mtk1\">-&gt;</span><span class=\"mtk11\">getTimestamp</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 class=\"mtk11\">header</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;HTTP/1.1 401 Unauthorized&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">exit</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>This code will provide all the necessary parameters to the decode function and save the method's result. Then, to prevent unauthorized access, error handling is employed. If any of the fields in the JWT are unavailable, an HTTP 401 error indicating unauthorized access will be issued to the user.</p>\n<h2 id=\"loginradius-authentication-for-php-apps\" style=\"position:relative;\"><a href=\"#loginradius-authentication-for-php-apps\" aria-label=\"loginradius authentication for php apps 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>LoginRadius Authentication for PHP Apps</h2>\n<p>Instead of using the process discussed above, you can use <a href=\"https://accounts.loginradius.com/auth.aspx?plan=developer\">LoginRadius Identity Platform</a> to authenticate your PHP APIs quickly. You can start by referring to <a href=\"https://www.loginradius.com/developers/\">LoginRadius PHP documentation</a>.</p>\n<p>In addition, you can use <a href=\"https://www.loginradius.com/developers/\">LoginRadius PHP SDK</a>, which, in turn, simplifies signup and login for your users by eliminating the need for remembering an extra set of credentials for your app.</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>In this tutorial, you've learned about JWT. Then created a PHP web application and secured it with JWT authentication.</p>\n<p>You understood how easy and important it is to secure a web application.</p>\n<p>You can <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/php\">find the complete code used in this tutorial here</a>.</p>\n<p>Don't forget to try this out for your more significant projects.</p>\n<p>Finally, if you face any problems following this tutorial or have questions, please feel free to comment below. We'll respond as soon as we can to clarify your questions.</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 .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk5 { color: #D16969; }\n  .dark-default-dark .mtk6 { color: #D7BA7D; }\n</style>","frontmatter":{"date":"December 24, 2021","updated_date":null,"description":"This tutorial helps you understand why you should secure your PHP API. Then, it helps you learn how to use JWT with Apache to secure your PHP API.","title":"How to Secure a PHP API Using JWT","tags":["PHP","JWT","Authentication"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/b9e157a812c5801bd8d6ca83f317ee88/58556/jwt.webp","srcSet":"/static/b9e157a812c5801bd8d6ca83f317ee88/61e93/jwt.webp 200w,\n/static/b9e157a812c5801bd8d6ca83f317ee88/1f5c5/jwt.webp 400w,\n/static/b9e157a812c5801bd8d6ca83f317ee88/58556/jwt.webp 800w,\n/static/b9e157a812c5801bd8d6ca83f317ee88/99238/jwt.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Harikrishna Kundariya","github":"espark-biz","avatar":null}}}},{"node":{"excerpt":"Introduction Identity management is swiftly becoming the need of the hour in a digitally advanced world where data breaches aren’t uncommon…","fields":{"slug":"/growth/questions-to-ask-your-identity-provider-2022/"},"html":"<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction 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>Introduction</h2>\n<p>Identity management is swiftly becoming the need of the hour in a digitally advanced world where data breaches aren’t uncommon, and cyber criminals continuously explore new ways to exploit sensitive consumer information. </p>\n<p>Yes, gone are the days when online businesses collecting user information considered <a href=\"https://www.loginradius.com/blog/identity/what-is-iam/\">identity management</a> a luxury; it’s the absolute necessity of every enterprise seeking a competitive edge with the highest level of security. </p>\n<p>So, does it mean that every business on the verge of digital transformation can’t navigate their digital business success without a reliable consumer identity and access management (CIAM) solution? </p>\n<p>Unfortunately, yes!</p>\n<p>CIAM is the backbone of every mobile application or website that collects user information, providers sign-in/sign-up, and maintains user data. </p>\n<p>So, if you’re thinking about getting a CIAM solution, here are some questions that you need to ask your identity provider in 2022. </p>\n<h3 id=\"1-what-authentication-methods-does-your-ciam-offer\" style=\"position:relative;\"><a href=\"#1-what-authentication-methods-does-your-ciam-offer\" aria-label=\"1 what authentication methods does your ciam offer 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>1. What authentication methods does your CIAM offer?</h3>\n<p>It’s crucial to know about the number of ways a user can authenticate themselves using a CIAM solution. The more the number of authentication methods, the better and user-friendly the CIAM is. </p>\n<h3 id=\"2-do-you-have-a-passwordless-login-option\" style=\"position:relative;\"><a href=\"#2-do-you-have-a-passwordless-login-option\" aria-label=\"2 do you have a passwordless login option 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>2. Do you have a passwordless login option?</h3>\n<p>Enterprises are inching towards <a href=\"https://www.loginradius.com/passwordless-login/\">passwordless login</a> capabilities to enhance the user experience for their consumers. You must ensure your CIAM offers cutting-edge technology with passwordless login capabilities just like LoginRadius. </p>\n<h3 id=\"3-can-i-get-single-sign-on-sso-capabilities-in-your-ciam\" style=\"position:relative;\"><a href=\"#3-can-i-get-single-sign-on-sso-capabilities-in-your-ciam\" aria-label=\"3 can i get single sign on sso capabilities in your ciam 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>3. Can I get single sign-on (SSO) capabilities in your CIAM?</h3>\n<p>Single Sign-On (SSO) is the most advanced way of creating a frictionless experience for clients when they switch from one application to another within a single platform. Ensure your CIAM offers SSO capabilities at no extra cost. </p>\n<h3 id=\"4-does-your-sso-provide-seamless-access-between-mobile-app-and-website\" style=\"position:relative;\"><a href=\"#4-does-your-sso-provide-seamless-access-between-mobile-app-and-website\" aria-label=\"4 does your sso provide seamless access between mobile app and website 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>4. Does your SSO provide seamless access between mobile app and website?</h3>\n<p>It’s essential to ensure seamless access through SSO when a user switches from website to mobile app without the hassle of re authentication since users find it pretty annoying to authenticate themselves again and again.</p>\n<h3 id=\"5-is-your-ciam-gdpr-and-ccpa-compliant\" style=\"position:relative;\"><a href=\"#5-is-your-ciam-gdpr-and-ccpa-compliant\" aria-label=\"5 is your ciam gdpr and ccpa compliant 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>5. Is your CIAM GDPR and CCPA compliant?</h3>\n<p>One of the essential aspects to consider while choosing a CIAM is to ensure whether the product offers GDPR, CCPA, and other data regularization compliances or not. Using a CIAM in certain states without complying with their local <a href=\"https://www.loginradius.com/gdpr-and-privacy/\">data privacy regulations</a> could entail the enterprise for hefty fines.</p>\n<h3 id=\"6-does-your-ciam-support-third-party-integrations\" style=\"position:relative;\"><a href=\"#6-does-your-ciam-support-third-party-integrations\" aria-label=\"6 does your ciam support third party integrations 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>6. Does your CIAM support third-party integrations?</h3>\n<p>CIAM that supports third-party integration always offers a competitive advantage to an organization. Businesses can get valuable insights into user behavior and past purchase history to create better marketing strategies.  </p>\n<h3 id=\"7-what-authentication-and-authorization-security-features-your-ciam-offers\" style=\"position:relative;\"><a href=\"#7-what-authentication-and-authorization-security-features-your-ciam-offers\" aria-label=\"7 what authentication and authorization security features your ciam offers 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>7. What authentication and authorization security features your CIAM offers?</h3>\n<p>Before making a purchase, make sure you precisely examine the authentication and authorization security mechanism of your CIAM.</p>\n<h3 id=\"8-does-it-have-risk-based-authentication-rba-adaptive-authentication\" style=\"position:relative;\"><a href=\"#8-does-it-have-risk-based-authentication-rba-adaptive-authentication\" aria-label=\"8 does it have risk based authentication rba adaptive authentication 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>8. Does it have risk-based authentication (RBA)/ adaptive authentication?</h3>\n<p>LoginRadius supports <a href=\"https://www.loginradius.com/blog/identity/risk-based-authentication/\">risk-based authentication</a> for the highest level of security. RBA, aka adaptive authentication, is a security mechanism for high-risk scenarios. Businesses collecting sensitive information regarding clients should always prefer risk-based authentication in addition to multi-factor authentication.</p>\n<h3 id=\"9-what-are-the-authentication-methods-apart-from-the-standard-password-login\" style=\"position:relative;\"><a href=\"#9-what-are-the-authentication-methods-apart-from-the-standard-password-login\" aria-label=\"9 what are the authentication methods apart from the standard password login 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>9. What are the authentication methods apart from the standard password login?</h3>\n<p>Make sure your CIAM vendor offers <a href=\"https://www.loginradius.com/social-login/\">social login authentication</a>, email login authentication, and phone/email authentication for maximum convenience and security. </p>\n<h3 id=\"10-can-i-move-data-from-my-previous-identity-provider\" style=\"position:relative;\"><a href=\"#10-can-i-move-data-from-my-previous-identity-provider\" aria-label=\"10 can i move data from my previous identity provider 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>10. Can I move data from my previous identity provider?</h3>\n<p>Some CIAM vendors like LoginRadius offer data export from a previous CIAM vendor. This helps in a flawless transition from a conventional vendor to a cutting-edge new-age CIAM.</p>\n<h3 id=\"11-how-can-your-ciam-help-increase-my-companys-sales-marketing-lead-generation-and-conversions\" style=\"position:relative;\"><a href=\"#11-how-can-your-ciam-help-increase-my-companys-sales-marketing-lead-generation-and-conversions\" aria-label=\"11 how can your ciam help increase my companys sales marketing lead generation and conversions 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>11. How can your CIAM help increase my company’s sales, marketing, lead generation, and conversions?</h3>\n<p>It’s important to learn about the features of the CIAM from a marketing and sales perspective. Your CIAM shouldn’t just provide a seamless login experience, but help improve conversion rates.  </p>\n<h3 id=\"12-do-i-need-to-purchase-different-features-separately-apart-from-the-subscription\" style=\"position:relative;\"><a href=\"#12-do-i-need-to-purchase-different-features-separately-apart-from-the-subscription\" aria-label=\"12 do i need to purchase different features separately apart from the subscription 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>12. Do I need to purchase different features separately apart from the subscription?</h3>\n<p>Ensure that you get every vital feature as a part of the standard subscription plan. </p>\n<h3 id=\"13-can-i-have-a-free-personalized-demo-of-the-product\" style=\"position:relative;\"><a href=\"#13-can-i-have-a-free-personalized-demo-of-the-product\" aria-label=\"13 can i have a free personalized demo of the product 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>13. Can I have a free personalized demo of the product?</h3>\n<p>It’s always a great idea to <a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=questions-to-ask-your-identity-provider-2022\">book a free personalized demo</a> before making a purchase. A customized demo helps you understand how the product works for your business since you get hands-on experience with every feature tailored for your organization. </p>\n<h3 id=\"14-what-if-i-need-to-import-previous-consumer-data-in-the-new-ciam\" style=\"position:relative;\"><a href=\"#14-what-if-i-need-to-import-previous-consumer-data-in-the-new-ciam\" aria-label=\"14 what if i need to import previous consumer data in the new ciam 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>14. What if I need to import previous consumer data in the new CIAM?</h3>\n<p>Leading CIAM vendors like LoginRadius provide you an option to import your previous consumer data like a breeze. Ensure your new CIAM vendor supports the same. </p>\n<h3 id=\"15-how-can-my-developers-benefit-from-your-ciam\" style=\"position:relative;\"><a href=\"#15-how-can-my-developers-benefit-from-your-ciam\" aria-label=\"15 how can my developers benefit from your ciam 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>15. How can my developers benefit from your CIAM?</h3>\n<p>Developers’ satisfaction regarding the product shouldn’t be ignored since they’re the backbone of the website/ application. Always choose a vendor offering transparency and total control to developers. </p>\n<h3 id=\"16-do-you-offer-multi-tenant-and-single-tenant-deployment\" style=\"position:relative;\"><a href=\"#16-do-you-offer-multi-tenant-and-single-tenant-deployment\" aria-label=\"16 do you offer multi tenant and single tenant deployment 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>16. Do you offer multi-tenant and single-tenant deployment?</h3>\n<p>Based on your cloud deployment requirement, always enquire about multi-tenant and <a href=\"https://www.loginradius.com/private-cloud/\">single-tenant cloud deployment</a> well in advance. </p>\n<h3 id=\"17-which-industries-benefit-the-most-from-your-ciam\" style=\"position:relative;\"><a href=\"#17-which-industries-benefit-the-most-from-your-ciam\" aria-label=\"17 which industries benefit the most from your ciam 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>17. Which industries benefit the most from your CIAM?</h3>\n<p>You need to ensure that your business niche market players trust the CIAM you consider. This will help you make a more intelligent choice. </p>\n<h3 id=\"18-what-is-the-up-time-of-your-data-servers\" style=\"position:relative;\"><a href=\"#18-what-is-the-up-time-of-your-data-servers\" aria-label=\"18 what is the up time of your data servers 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>18. What is the up-time of your data servers?</h3>\n<p>Don’t forget to inquire about the up-time of the servers since consumer experience is everything you need to focus on while choosing a CIAM. LoginRadius identity management solution offers <a href=\"https://www.loginradius.com/scalability/\">100% uptime</a>. </p>\n<h3 id=\"19-where-are-your-data-centers-physically-located\" style=\"position:relative;\"><a href=\"#19-where-are-your-data-centers-physically-located\" aria-label=\"19 where are your data centers physically located 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>19. Where are your data centers physically located?</h3>\n<p>It’s essential to know about the physical location of the data centers to ensure data is securely collected, managed, and saved. </p>\n<h3 id=\"20-do-you-comply-with-data-localization-for-the-different-states\" style=\"position:relative;\"><a href=\"#20-do-you-comply-with-data-localization-for-the-different-states\" aria-label=\"20 do you comply with data localization for the different states 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>20. Do you comply with data localization for the different states?</h3>\n<p>You shouldn’t miss data localization compliance in your next CIAM since data privacy and security regularizations are becoming increasingly stringent globally. </p>\n<h3 id=\"21-what-is-the-peak-load-capacity-of-your-ciam\" style=\"position:relative;\"><a href=\"#21-what-is-the-peak-load-capacity-of-your-ciam\" aria-label=\"21 what is the peak load capacity of your ciam 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>21. What is the peak load capacity of your CIAM?</h3>\n<p>The peak load capacity of the CIAM defines how good and reliable a CIAM is handling a massive number of users at once. Always choose the one offering higher peak load capacities like LoginRadius CIAM offering 180K logins/second. </p>\n<h3 id=\"22-how-many-identities-have-you-secured-till-date\" style=\"position:relative;\"><a href=\"#22-how-many-identities-have-you-secured-till-date\" aria-label=\"22 how many identities have you secured till date 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>22. How many identities have you secured till date?</h3>\n<p>Last but not least, you need to ask your vendor regarding the total number of identities that they have secured till data. Choosing the one with a higher number of secured identities could be the game-changer for your business, just like LoginRadius that has secured over 1.17 Billion identities to date. </p>\n<h2 id=\"the-bottom-line\" style=\"position:relative;\"><a href=\"#the-bottom-line\" aria-label=\"the bottom line 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>The Bottom Line</h2>\n<p>Choosing a reliable CIAM isn’t a piece of cake, and organizations should strictly examine the aspects mentioned above in the form of questions that they need to ask <a href=\"https://www.loginradius.com/\">CIAM vendors</a>. </p>\n<p>However, LoginRadius offers endless possibilities and provides all the features, compliances, and capabilities mentioned above. </p>\n<p>You can choose LoginRadius as your CIAM to witness substantial business growth. Reach us for a free personalized demo today.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=questions-to-ask-your-identity-provider-2022\"><img src=\"/8fce571f703a5970dbb1359a2fe0e51a/book-a-demo-loginradius.webp\" alt=\"book-a-demo-loginradius\"></a></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":"December 21, 2021","updated_date":null,"description":"CIAM is the backbone of every mobile application or website that collects user information. So, if you’re thinking about getting a CIAM solution, here are some questions that you need to ask your identity provider in 2022.","title":"What Should You Ask Your Identity Provider in 2022","tags":null,"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.4492753623188406,"src":"/static/d041213ab6bca69bb94526978153bba4/7f8e9/id-provider.webp","srcSet":"/static/d041213ab6bca69bb94526978153bba4/61e93/id-provider.webp 200w,\n/static/d041213ab6bca69bb94526978153bba4/1f5c5/id-provider.webp 400w,\n/static/d041213ab6bca69bb94526978153bba4/7f8e9/id-provider.webp 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Yash Rathi","github":"yashrathi29","avatar":null}}}},{"node":{"excerpt":"In a modern, digitally advanced environment, business systems undergo complex interactions and communicate autonomously to execute business…","fields":{"slug":"/identity/loginradius-m2m-authorization-data-access/"},"html":"<p>In a modern, digitally advanced environment, business systems undergo complex interactions and communicate autonomously to execute business functions. </p>\n<p>Every day, millions of devices constantly gather and report data, especially concerning the Internet of Things (IoT) ecosystem, which doesn’t even require human intervention. </p>\n<p>Hence, business systems need to efficiently and securely share this data during transit to the suitable systems and issue operational instructions without room for tampering.</p>\n<p>Here’s where LoginRadius’ Machine to Machine (M2M) authorization comes into play. </p>\n<p>Machine-to-machine (M2M) authorization ensures that business systems communicate autonomously without human intervention and access the needed information through granular-level access.</p>\n<p>M2M Authorization is exclusively used for scenarios in which a business system authenticates and authorizes a service rather than a user. </p>\n<p>Let’s dig deeper into this and understand the role of M2M authorization and how it helps diverse businesses. </p>\n<h2 id=\"intent-behind-the-launch\" style=\"position:relative;\"><a href=\"#intent-behind-the-launch\" aria-label=\"intent behind the launch 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>Intent Behind the Launch</h2>\n<p>M2M Authorization is the process of providing remote systems with secure access to information. Using M2M Authorization, business systems can communicate autonomously and execute business functions based on predefined authorization.</p>\n<p>M2M apps use the Client Credentials Flow (defined in OAuth 2.0 RFC 6749), in which they pass along secure credentials to authenticate themselves and receive an <a href=\"https://www.loginradius.com/blog/identity/pros-cons-token-authentication/\">authorization token</a>.</p>\n<p>LoginRadius understands the risks associated with data transfers, especially in cases where millions of interconnected applications and devices contact each other to gain access to specific resources or devices. This access requires a robust authorization mechanism. </p>\n<p>Machine-to-machine authorization from LoginRadius acts as a game-changer for the business that requires frequent autonomous interactions. </p>\n<h2 id=\"how-does-it-work\" style=\"position:relative;\"><a href=\"#how-does-it-work\" aria-label=\"how does it work 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 does it Work?</h2>\n<p>Services require authorization while saving and reading the data to and from the storage as a part of standard process and security measures. Businesses can use LoginRadius for autonomous authorization by creating two dedicated M2M apps with write and read permissions.</p>\n<p>For each M2M application, LoginRadius issues secure credentials, and services automatically get the authorization token from LoginRadius using these <a href=\"https://www.loginradius.com/blog/identity/login-security/\">secure credentials</a> to perform read or write operations. </p>\n<p><a href=\"https://www.loginradius.com/resource/m-to-m-authorization-\"><img src=\"/3668282664aff852df5f47b46e47d874/DS-M2M.webp\" alt=\"DS-M2M\"></a></p>\n<p>In a nutshell, LoginRadius acts as an authorization server. </p>\n<p>Benefits of LoginRadius’ M2M Authorization</p>\n<p>M2M Authorization offers secure access to improve business efficiency and ultimately enhances customer experience. M2M provides several business benefits, including, but not limited to: </p>\n<ul>\n<li>Secure data access across multiple business systems</li>\n<li>Granular data access with predefined scopes</li>\n<li>Efficient authentication and data exchange </li>\n<li>Grant, limit, or block access permissions at any time</li>\n</ul>\n<h2 id=\"final-thoughts\" style=\"position:relative;\"><a href=\"#final-thoughts\" aria-label=\"final thoughts 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>Final Thoughts</h2>\n<p>Businesses these days require a robust <a href=\"https://www.loginradius.com/blog/identity/authentication-vs-authorization-infographic/\">authorization and authentication</a> mechanism that can carry data access requests like a breeze without hampering the overall business process. </p>\n<p>With LoginRadius M2M authorization, businesses can ensure a secure and reliable method of autonomous interactions since it aids business systems to achieve efficiency and, at the same time, eliminates the need for human intervention. </p>\n<p>LoginRadius M2M helps businesses to provide flexible machine-to-machine communication while ensuring granular access, authorization, and security requirements are enforced.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=loginradius-m2m-authorization-data-access\"><img src=\"/dc606ee34e1fd846630cfcbae3647780/BD-Developers2-1024x310.webp\" alt=\"Book-a-demo-loginradius\"></a></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":"December 15, 2021","updated_date":null,"description":"Machine to Machine (M2M) authorization ensures that business systems communicate autonomously without human intervention and access the needed information securely and reliably.","title":"LoginRadius Launches M2M Authorization for Seamless Business Operations","tags":["industry-news","authorization","authentication"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/ced52bfc8a52c08c841eeee065711480/58556/m2m-cover.webp","srcSet":"/static/ced52bfc8a52c08c841eeee065711480/61e93/m2m-cover.webp 200w,\n/static/ced52bfc8a52c08c841eeee065711480/1f5c5/m2m-cover.webp 400w,\n/static/ced52bfc8a52c08c841eeee065711480/58556/m2m-cover.webp 800w,\n/static/ced52bfc8a52c08c841eeee065711480/cc834/m2m-cover.webp 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},{"node":{"excerpt":"Securing communications between a client and a server often requires credentials to identify both parties. That is where the different…","fields":{"slug":"/engineering/cookie-based-vs-cookieless-authentication/"},"html":"<p>Securing communications between a client and a server often requires credentials to identify both parties. That is where the different authentication techniques comes in. Two popular authentication methods are cookie-based and cookieless authentication. However, choosing any one of them depends on the organization's requirements. Both come with their benefits and challenges. This article will give a quick walkthrough of cookie-based and cookieless authentication along with their advantages and disadvantages.</p>\n<h2 id=\"what-is-cookie-based-authentication\" style=\"position:relative;\"><a href=\"#what-is-cookie-based-authentication\" aria-label=\"what is cookie based authentication 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>What is Cookie-based Authentication?</h2>\n<p>Cookies are pieces of data used to identify the user and their preferences. The browser returns the cookie to the server every time the page is requested. Specific cookies like HTTP cookies are used to perform cookie-based authentication to maintain the session for each user.</p>\n<p>The entire cookie-based authentication works in the following manner:</p>\n<ol>\n<li>The user gives a username and password at the time of login. Once the user fills in the login form, the browser (client) sends a login request to the server.</li>\n<li>\n<p>The server verifies the user by querying the user data. If the authentication request is valid, the server generates the following:</p>\n<ul>\n<li>A session by utilizing the user information</li>\n<li>A unique ID, known as the session ID</li>\n</ul>\n<p>The server then passes the session ID to the browser that keeps it. The server also keeps track of the active sessions.</p>\n</li>\n<li>The browser has to submit this generated session ID while sending a subsequent request. Every time the server validates the session ID. The session ID helps the authentication process identify the user and provides access accordingly.</li>\n<li>When the user logs out of the application, the session gets destroyed from both client (browser) and the server. It discontinues the authentication process from happening again through the respective session ID.</li>\n</ol>\n<h3 id=\"benefits-of-cookie-based-authentication\" style=\"position:relative;\"><a href=\"#benefits-of-cookie-based-authentication\" aria-label=\"benefits of cookie based authentication 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>Benefits of Cookie-based Authentication</h3>\n<ul>\n<li><strong>Availability:</strong> In cookies-based authentication, cookies can be made available for an extended period, maintaining a session for a long time.</li>\n<li><strong>Easy Configuration:</strong> Websites can deliver cookies by configuring them as per requirement. For example, a website can send cookies that will expire as the users close the browser tab. It is also possible to configure cookies for a specified length of time on the client-side.</li>\n<li><strong>User-friendly:</strong> Cookie-based authentications are simple, and the cookies used in this method are user-friendly. Users can choose what to do with cookie files that have kept user credentials. All modern browsers come with settings to clear the cookies. Users can find cookies in the hard drive and delete them manually.</li>\n</ul>\n<h3 id=\"challenges-of-cookie-based-authentication\" style=\"position:relative;\"><a href=\"#challenges-of-cookie-based-authentication\" aria-label=\"challenges of cookie based authentication 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>Challenges of Cookie-based Authentication</h3>\n<ul>\n<li><strong>Vulnerable to CSRF:</strong> Cookie-based authentications are prone to <a href=\"https://www.loginradius.com/blog/engineering/introduction-to-cross-site-request-forgery-csrf/\">Cross-site Request Forgery (CSRF) attacks</a>. Hence, they often require additional security postures for protection.</li>\n<li><strong>Less Mobile-friendly:</strong> Cookie-based authentication does not work well with all native applications.</li>\n<li><strong>Limitations:</strong> There are certain limitations and concerns such as size limit (not more than 4KB of information per cookie), browser limitations on cookies, user privacy, etc., come with cookies and cookie-based authentication.</li>\n<li><strong>Less Scalable:</strong> Cookie-based authentication is less scalable, and the overhead rises when the user count increases on a particular site.</li>\n</ul>\n<h2 id=\"what-is-cookieless-authentication\" style=\"position:relative;\"><a href=\"#what-is-cookieless-authentication\" aria-label=\"what is cookieless authentication 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>What is Cookieless Authentication?</h2>\n<p>Cookieless authentication, also known as token-based authentication, is a technique that leverages JSON web tokens (JWT) instead of cookies to authenticate a user. It uses a protocol that creates encrypted security tokens. These tokens allow the user to verify their identity. In return, the users receive a unique access token to perform the authentication. The token contains information about user identities and transmits it securely between the server and client.\nThe entire cookieless authentication works in the following manner:</p>\n<ol>\n<li>The user logs into the service by providing their login credentials. It issues an access request from the client-side by sending the credential and API key (public key) to the application server.</li>\n<li>The server verifies the login credentials that checks the password entered against the username. Once approved, the server will generate a unique session token that will help authorize subsequent actions.</li>\n<li>This access token is sent back to the client via URL query strings, post request body, or other means. The server-generated signed authentication token gets assigned with an expiration time.</li>\n<li>The token gets transmitted back to the user's browser. On every subsequent request to the application server or future website visits, the access token gets added to the authorization header along with the public key. If there is a match from the application server against the private key, the user can proceed. If a given token expires, a new token gets generated as an authentication request.</li>\n</ol>\n<h3 id=\"benefits-of-cookieless-authentication\" style=\"position:relative;\"><a href=\"#benefits-of-cookieless-authentication\" aria-label=\"benefits of cookieless authentication 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>Benefits of Cookieless Authentication</h3>\n<ul>\n<li><strong>Scalable and Efficient:</strong> In cookieless authentication, the tokens remain stored on the user's end. The server only needs to sign the authentication token once on successful login. That makes the entire technique scalable and allows maintaining more users on an application at once without any hassle.</li>\n<li><strong>Better Performance:</strong> Cookie-based authentication requires the server to perform an authentication lookup every time the user requests a page. You can eliminate the round-trips with tokens through the cookieless authentication technique. In cookieless authentication, the access token and the public key are added to the authorization header on every page request.</li>\n<li><strong>Robust Security:</strong> Since cookieless authentication leverages tokens like JWT (stateless), only a private key (used to create the authentication token) can validate it when received at the server-side.</li>\n<li><strong>Seamless Across Devices:</strong> Cookieless authentication works well with all native applications. Tokens are much easier to implement on iOS, Android, IoT devices, and distributed systems, making the authentication system seamless.</li>\n<li><strong>Expiration Time:</strong> Usually, tokens get generated with an expiration time, after which they become invalid. Then a new token needs to be obtained for reauthentication. If a token gets leaked, the potential damage becomes much smaller due to its short lifespan.</li>\n</ul>\n<h3 id=\"challenges-with-cookieless-authentication\" style=\"position:relative;\"><a href=\"#challenges-with-cookieless-authentication\" aria-label=\"challenges with cookieless authentication 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>Challenges with Cookieless Authentication</h3>\n<ul>\n<li><strong>Single-key Token:</strong> One of the significant challenges with cookieless authentication is that these access tokens rely on just one key. Tokens that use JWT leverages a single key for authentication. If the developers/administrators handle the key poorly, it can lead to severe consequences that can compromise sensitive information.</li>\n<li><strong>Data Overhead:</strong> Storing a lot of data increases the overall size of the token. It slows down the request impacting the overall loading speed. This slowing down ultimately hampers the user experience. Thus proper development practices need to be followed, regulating minimum but essential data into the token.</li>\n<li><strong>Vulnerable to XSS and CSRF:</strong> Cookieless authentications are susceptible to <a href=\"https://www.loginradius.com/blog/engineering/http-security-headers/\">XSS</a> and CSRF attacks. So, the best practice is to have a short expiration time for access tokens. Keeping a longer expiration time might allow the attackers to hijack the access token and use it to gain unauthorized authentication.</li>\n</ul>\n<h2 id=\"how-does-loginradius-have-native-support-for-cookieless-authentication\" style=\"position:relative;\"><a href=\"#how-does-loginradius-have-native-support-for-cookieless-authentication\" aria-label=\"how does loginradius have native support for cookieless authentication 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 does LoginRadius have Native Support for Cookieless Authentication?</h2>\n<p>LoginRadius provides multiple methods to implement a cookieless login workflow leveraging industry and security best practices. As a consumer-centric Identity platform, LoginRadius ensures that modern implementation methodologies comply with the changing security landscape. The cookieless authentication workflows detailed below are systems that LoginRadius has developed support for even before the recent browser-based privacy policies and are a core part of the LoginRadius platform.</p>\n<h3 id=\"loginradius-apis\" style=\"position:relative;\"><a href=\"#loginradius-apis\" aria-label=\"loginradius apis 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>LoginRadius APIs</h3>\n<p>The LoginRadius API has been architected and designed to function as a cookieless authentication system. Once authentication occurs, a session token gets returned to the requesting client in the form of an access token which can be leveraged to take further authorized actions against the Consumer account. It is a core part of the LoginRadius authentication workflows, and APIs developed based on Oauth 2.0 protocols.</p>\n<p>These APIs provide flexibility in generating access tokens based on consumer authentication requests and are automatically validated and signed leveraging the LoginRadius API Key and Secret. <a href=\"https://www.loginradius.com/developers/\">Detailed API documentation is available here</a>.</p>\n<h3 id=\"json-web-tokens\" style=\"position:relative;\"><a href=\"#json-web-tokens\" aria-label=\"json web tokens 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>JSON Web Tokens</h3>\n<p>In addition to the LoginRadius APIs, JWTs are a standard method to handle cookieless login. Once authentication is completed and verified, a signed token can be generated(leveraging LoginRadius APIs) to pass the consumer session to the client.</p>\n<p>JWTs are a standard industry mechanism leveraged by various service providers and tools, making them ideal for interoperability with multiple applications. Find additional details on <a href=\"https://www.loginradius.com/developers/\">how to use JWT as part of your authentication workflows here</a>.</p>\n<h3 id=\"additional-options\" style=\"position:relative;\"><a href=\"#additional-options\" aria-label=\"additional options 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>Additional Options</h3>\n<p>In addition to the above two options, LoginRadius provides flexibility and support for various authentication and authorization standards that support a cookieless authentication approach. Outbound authentication workflows such as OIDC and Oauth 2.0 allow for a modern standardized approach to authentication.</p>\n<p>These are industry-recognized and recommended authentication and authorization protocols that comply with security and privacy best practices, including supporting a cookieless authentication approach. Check out <a href=\"https://www.loginradius.com/developers/\">our dedicated documentation on outbound workflows</a>.</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>Cookieless authentication can facilitate more secure and scalable authentication. You should decide how to authenticate consumers considering your requirements and the benefits and challenges of cookie-based and cookieless authentication.</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":"December 14, 2021","updated_date":null,"description":"Understand how cookie-based and cookieless authentication methods work. And learn their major differences, advantages, and disadvantages.","title":"Cookie-based vs. Cookieless Authentication: What’s the Future?","tags":["Authentication","JWT","Cookie"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/0be9d40cc7bb77e9feb433ff59d7514a/58556/coverImage.webp","srcSet":"/static/0be9d40cc7bb77e9feb433ff59d7514a/61e93/coverImage.webp 200w,\n/static/0be9d40cc7bb77e9feb433ff59d7514a/1f5c5/coverImage.webp 400w,\n/static/0be9d40cc7bb77e9feb433ff59d7514a/58556/coverImage.webp 800w,\n/static/0be9d40cc7bb77e9feb433ff59d7514a/99238/coverImage.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"excerpt":"Introduction Marketing is one of the main components of business management and commerce. Consumer response to your product depends highly…","fields":{"slug":"/growth/consumer-identity-rule-personalized-marketing-2022/"},"html":"<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction 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>Introduction</h2>\n<p>Marketing is one of the main components of business management and commerce. Consumer response to your product depends highly on the marketing strategy adopted by businesses. How you are selling your product or service is of more significance than what you are selling.</p>\n<p>Personalization is becoming more and more common these days with <a href=\"https://www.loginradius.com/resource/the-enterprise-buyers-guide-to-consumer-identity/\">consumer identity</a> at the center of it all. In personalization, the entire consumer experience and services revolve around a consumer and how they connect with a brand personally. </p>\n<h2 id=\"what-is-consumer-identity\" style=\"position:relative;\"><a href=\"#what-is-consumer-identity\" aria-label=\"what is consumer identity 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>What is Consumer Identity</h2>\n<p>Consumer identity can be described as the pattern of consumers- what are the products they are buying? How are they interacting with brands? Which platforms are they using to interact with brands? All these things can be included in consumer identity.</p>\n<p>Consumer identity can be obtained in many ways. Organizations can gather data like contact details, age or demographic details, social identity, etc. All these factors help the organizations make the marketing experience personalized for the customers.</p>\n<p>Customer identity and personalization have benefitted customers in numerous ways, but the main concern for people is- safety. </p>\n<p>By implementing a customer identity and access management system, numerous organizations leverage authorization and authentication of users to keep data safe.</p>\n<p>Let's talk more about it.</p>\n<h2 id=\"what-is-customer-identity-and-access-management\" style=\"position:relative;\"><a href=\"#what-is-customer-identity-and-access-management\" aria-label=\"what is customer identity and access 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>What is Customer Identity and Access Management</h2>\n<p><a href=\"https://www.loginradius.com/blog/identity/customer-identity-and-access-management/\">Customer identity and access management</a> (CIAM) regulates the authentication and authorization of users who interact with different applications. This system revolves around a customer account that has all the information provided by the user. Using this information, the application makes the entire experience personalized for the user. </p>\n<p><strong>Customer identity programs for marketing</strong> can enhance the user experience by making it safer and easier. </p>\n<h2 id=\"benefits-of-using-customer-identity-programs-for-personalized-marketing\" style=\"position:relative;\"><a href=\"#benefits-of-using-customer-identity-programs-for-personalized-marketing\" aria-label=\"benefits of using customer identity programs for personalized marketing 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>Benefits of Using Customer Identity Programs for Personalized Marketing</h2>\n<p>With the digitization of business operations, including marketing, customers are focusing more on user experience and data safety. This may be achieved through consumer identity and access management to create a safe and individualized interface for users. </p>\n<ul>\n<li><strong><em>Sign in or registration</em></strong></li>\n</ul>\n<p>When registering for an application the first time, you have to fill out details, including your email id, user name, password, social identity, contact details, social media handles etc; some applications also need other preferences. The main objectives of sharing these details are: </p>\n<ol>\n<li>Authentication</li>\n<li>Personalization</li>\n</ol>\n<p>After this, the application observes your activities and keeps the interface evolving according to the user activities.</p>\n<p><a href=\"https://www.loginradius.com/resource/guide-to-modern-customer-identity/\"><img src=\"/106a246e0adbf482565e194a895c4b94/EB-GD-to-Mod-Cust-ID.webp\" alt=\"EB-GD-to-Mod-Cust-ID\"></a></p>\n<ul>\n<li><strong><em>Multi-factor authentication</em></strong></li>\n</ul>\n<p>In most applications, authentication ends with registration, where the user has to generate an ID and a password. But this is not the case with CIAM. What makes CIAM more secure than other systems is its feature of ongoing authentication. The application continuously works on context-sensitive data and behavioral factors to authenticate the user in an ongoing authentication.</p>\n<p><a href=\"https://www.loginradius.com/multi-factor-authentication/\">Multi-factor authentication</a> does require many sign-ups, but it uses other methods like codes, one time passwords and a series of questions that are usually personal. </p>\n<p>For example, in the case of net banking, you sign into your account to authorize a transaction. Before finalizing the transaction, you have to enter a specific code sent to your contact number or email address. </p>\n<ul>\n<li><strong><em>Central data management</em></strong></li>\n</ul>\n<p>The <a href=\"https://www.loginradius.com/blog/fuel/how-to-make-personalized-marketing-effective-with-consumer-identity/\">consumer identity program for marketing</a> uses consumer data and information to analyze and personalize the activities. An application has multiple functions and users, which results in a huge amount of data to store and process. Huge data is not the problem; scattered data is. </p>\n<p>The effective and efficient use of data is possible only when it is organized systematically. CIAM uses a central data dashboard that stores all the relevant data in one place. There, data can be retrieved, updated and added without causing any disruption to the system. </p>\n<ul>\n<li><strong><em>Encryption</em></strong></li>\n</ul>\n<p>Consumer data is precious for your business, and its safety is the number one concern of the users. But, what happens in case of a data breach? If you are using CIAM for your business, you don't have to worry as the system does high-end data encryption while performing other functions. User authentication and data encryption make data more secure in cases of breaches. </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>There are many benefits of consumer identity programs for marketing, the two most important benefits being safety and personalization. Both of these can be achieved by proper implementation of CIAM from the business leaders. </p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=consumer-identity-rule-personalized-marketing-2022\"><img src=\"/8fce571f703a5970dbb1359a2fe0e51a/book-a-demo-loginradius.webp\" alt=\"book-a-demo-Consultation\"></a></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":"December 14, 2021","updated_date":null,"description":"Consumer identity management is actually a great way to help companies grow. It is through high quality CIAM that a business can create better targeted, safer, more meaningful marketing experiences for their customers.","title":"Do Consumer Identity Programs Really Work for Personalized Marketing?","tags":["identity management","ciam solution","mfa","cx"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.694915254237288,"src":"/static/98e924b770d7fc513e3cdb7e99c9804c/58556/personalized-marketing.webp","srcSet":"/static/98e924b770d7fc513e3cdb7e99c9804c/61e93/personalized-marketing.webp 200w,\n/static/98e924b770d7fc513e3cdb7e99c9804c/1f5c5/personalized-marketing.webp 400w,\n/static/98e924b770d7fc513e3cdb7e99c9804c/58556/personalized-marketing.webp 800w,\n/static/98e924b770d7fc513e3cdb7e99c9804c/cc834/personalized-marketing.webp 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Navanita Devi","github":null,"avatar":null}}}}]},"markdownRemark":{"excerpt":"Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards…","fields":{"slug":"/identity/developer-first-identity-provider-loginradius/"},"html":"<p>Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards and refining approaches to building secure, seamless experiences.</p>\n<p>We’re here to support developers on that journey. We know how important simplicity, efficiency, and well-structured documentation are when working with identity and access management solutions. That’s why we’ve redesigned the <a href=\"https://www.loginradius.com/\">LoginRadius website</a>—to be faster, more intuitive, and developer-first in every way.</p>\n<p>The goal? Having them spend less time searching and more time building.</p>\n<h2 id=\"whats-new-and-improved-on-the-loginradius-website\" style=\"position:relative;\"><a href=\"#whats-new-and-improved-on-the-loginradius-website\" aria-label=\"whats new and improved on the loginradius website 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>What’s New and Improved on the LoginRadius Website?</h2>\n<p>LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve spent the last few months redesigning our interface— making navigation more intuitive and reassuring that essential resources are easily accessible.</p>\n<p>Here’s a closer look at what’s new and why it’s important:</p>\n<h3 id=\"a-developer-friendly-dark-theme\" style=\"position:relative;\"><a href=\"#a-developer-friendly-dark-theme\" aria-label=\"a developer friendly dark theme 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>A Developer-Friendly Dark Theme</h3>\n<p><img src=\"/f46881583c7518a93bb24e94c32320de/a-developer-friendly-dark-theme.webp\" alt=\"This image shows how LoginRadius offers several authentication methods like traditional login, social login, passwordless login, passkeys and more in a dark mode.\">    </p>\n<p>Developers spend long hours working in dark-themed IDEs and terminals, so we’ve designed the LoginRadius experience to be developer-friendly and align with that preference.</p>\n<p>The new dark mode reduces eye strain, enhances readability, and provides a seamless transition between a coding environment and our platform. Our new design features a clean, modern aesthetic with a consistent color scheme and Barlow typography, ensuring better readability. High-quality graphics and icons are thoughtfully placed to enhance the content without adding visual clutter.</p>\n<p>So, whether you’re navigating our API docs or configuring authentication into your system, our improved interface will make those extended development hours more comfortable and efficient.</p>\n<h3 id=\"clear-categorization-for-loginradius-capabilities\" style=\"position:relative;\"><a href=\"#clear-categorization-for-loginradius-capabilities\" aria-label=\"clear categorization for loginradius capabilities 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>Clear Categorization for LoginRadius Capabilities</h3>\n<p><img src=\"/e5358b82be414940f3fb146013845933/capabilities.webp\" alt=\"This image shows a breakdown of all the LoginRadius CIAM capabilities, including authentication, security, UX, scalability and multi-brand management.\"></p>\n<p>We’ve restructured our website to provide a straightforward breakdown of our customer identity and access management platform capabilities, helping you quickly find what you need:</p>\n<ul>\n<li>Authentication: Easily understand <a href=\"https://www.loginradius.com/blog/identity/authentication-option-for-your-product/\">how to choose the right login method</a>, from traditional passwords and OTPs to social login, federated SSO, and passkeys with few lines of code.</li>\n<li>Security: Implement no-code security features like bot detection, IP throttling, breached password alerts, DDoS protection, and adaptive MFA to safeguard user accounts.</li>\n<li>User Experience: Leverage AI builder, hosted pages, and drag-and-drop workflows to create smooth, branded sign-up and login experiences.</li>\n<li>High Performance &#x26; Scalability: Confidently scale with sub-100ms API response times, 100% uptime, 240K+ RPS, and 28+ global data center regions.</li>\n<li>Multi-Brand Management: Efficiently manage multiple identity apps, choosing isolated or shared data stores based on your brand’s unique needs.</li>\n</ul>\n<p>This structured layout ensures you can quickly understand each capability and how it integrates into your identity ecosystem.</p>\n<h3 id=\"developer-first-navigation\" style=\"position:relative;\"><a href=\"#developer-first-navigation\" aria-label=\"developer first navigation 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>Developer-First Navigation</h3>\n<p><img src=\"/a8c155c2b6faf3d5f4b4de4e2b14d763/developers-menu.webp\" alt=\"This image shows the LoginRadius menu bar, highlighting the developer dropdown.\">   </p>\n<p>We’ve been analyzing developer workflows to identify how you access key resources. That’s why we redesigned our navigation with one goal in mind: to reduce clicks and make essential resources readily available.</p>\n<p>The new LoginRadius structure puts APIs, SDKs, and integration guides right at the menu bar under the Developers dropdown so you can get started faster. Our Products, Solutions, and Customer Services are also clearly categorized, helping development teams quickly find the right tools and make informed decisions.</p>\n<h3 id=\"quick-understanding-of-integration-benefits\" style=\"position:relative;\"><a href=\"#quick-understanding-of-integration-benefits\" aria-label=\"quick understanding of integration benefits 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>Quick Understanding of Integration Benefits</h3>\n<p><img src=\"/b2f9a964a2da0ea83e2f8596b833bba7/we-support-your-tech-stack.webp\" alt=\"This image shows a list of popular programming languages and frameworks offered by LoginRadius.\"></p>\n<p>Developers now have a clear view of the tech stack available with LoginRadius, designed to support diverse business needs.</p>\n<p>Our platform offers pre-built SDKs for Node.js, Python, Java, and more, making CIAM integration seamless across popular programming languages and frameworks.</p>\n<h2 id=\"over-to-you-now\" style=\"position:relative;\"><a href=\"#over-to-you-now\" aria-label=\"over to you now 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>Over to You Now!</h2>\n<p>Check out our <a href=\"https://www.loginradius.com/\">revamped LoginRadius website</a> and see how the improved experience makes it easier to build, scale, and secure your applications.</p>\n<p>Do not forget to explore the improved navigation and API documentation, and get started with our free trial today. We’re excited to see what you’ll build with LoginRadius!</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":"February 21, 2025","updated_date":null,"description":"LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve redesigned our website interface, making navigation more intuitive and reassuring that essential resources are easily accessible.","title":"Revamped & Ready: Introducing the New Developer-First LoginRadius Website","tags":["Developer tools","API","Identity Management","User Authentication"],"pinned":true,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7857142857142858,"src":"/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp","srcSet":"/static/80b4e4fbe176a10a327d273504607f32/61e93/hero-section.webp 200w,\n/static/80b4e4fbe176a10a327d273504607f32/1f5c5/hero-section.webp 400w,\n/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp 800w,\n/static/80b4e4fbe176a10a327d273504607f32/99238/hero-section.webp 1200w,\n/static/80b4e4fbe176a10a327d273504607f32/7c22d/hero-section.webp 1600w,\n/static/80b4e4fbe176a10a327d273504607f32/1258b/hero-section.webp 2732w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},"pageContext":{"limit":6,"skip":342,"currentPage":58,"type":"///","numPages":164,"pinned":"ee8a4479-3471-53b1-bf62-d0d8dc3faaeb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}