Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Easy Authentication Using Hanko.io

Building dependable online apps in the rapidly changing world of web development today requires smooth and secure authentication. A contemporary, safe, and passwordless method of user authentication is provided by Hanko, a robust…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Building dependable online apps in the rapidly changing world of web development today requires smooth and secure authentication. A contemporary, safe, and passwordless method of user authentication is provided by Hanko, a robust authentication API. I'll demonstrate how to integrate Hanko Elements and Hanko API into a React application in this blog post, and then I'll show you a demonstration of the authentication system we created.



Let's get started!



What is Hanko?



Hanko is an authentication service that offers a passwordless experience to streamline the user authentication process. Because it supports WebAuthn, developers may use security keys, biometrics, or other passwordless login methods. Additionally, Hanko offers pre-made user interface components (known as Hanko Elements) to facilitate a smooth integration process.



Step 1: Setting Up Your React Application



First, if you haven’t already, initialize a React application using the following commands:




npx create-react-app hanko
cd hanko
npm install react-router-dom
npm start






This will create a new React project and spin up the development server.



Step 2: Install Hanko Elements



Next, install the Hanko Elements library to get access to their pre-built authentication components:




npm install @teamhanko/hanko-elements






This package will allow us to easily embed Hanko authentication elements into our React components.



Step 3: Configure Hanko in Your Application



Before diving into the code, you’ll need to sign up at Hanko.io and get your API key. After setting up your Hanko project, you can retrieve the Hanko API base URL and Hanko API key from your dashboard.



Add these values to your environment variables in the .env file:




REACT_APP_HANKO_API_URL=<YOUR_HANKO_API_BASE_URL>
REACT_APP_HANKO_API_KEY=<YOUR_HANKO_API_KEY>






Step 4: Building the Authentication Flow



Now that we have the project set up and the Hanko Elements installed, let's move on to integrating the authentication functionality.



Create a Login.js file that will handle user authentication:




import React from "react";
import { useEffect, useCallback, useMemo, useState } from "react";
import { useNavigate } from "react-router-dom";
import { register, Hanko } from "@teamhanko/hanko-elements";

const hankoApi = process.env.REACT_APP_HANKO_API_URL;

function Login() {
const navigate = useNavigate();
const hanko = useMemo(() => new Hanko(hankoApi), []);
const [userState, setUserState] = useState({
id: "",
email: "",
error: "",
});

const [sessionState, setSessionState] = useState({
userID: "",
jwt: "",
isValid: false,
error: "",
});

const redirectAfterLogin = useCallback(() => {
navigate("/logout");
}, [navigate]);

useEffect(
() =>
hanko.onSessionCreated(() => {
hanko?.user
.getCurrent()
.then(({ id, email }) => {
setUserState({ id, email, error: "" });
console.log(id,email)
})
.catch((error) => {
setUserState((prevState) => ({ ...prevState, error: error }));
});
redirectAfterLogin();
}),
[hanko, redirectAfterLogin]
);

useEffect(() => {
if (hanko) {
const isValid = hanko.session.isValid();
const session = hanko.session.get();

if (isValid && session) {
const { userID, jwt = "" } = session;
setSessionState({
userID,
jwt,
isValid,
error: null,
});
console.log(jwt);
} else {
setSessionState((prevState) => ({
...prevState,
isValid: false,
error: "Invalid session",
}));
}
}
}, [hanko]);

useEffect(() => {
register(hankoApi).catch((error) => {
console.log(error);
});
}, []);
return (
<div className="m-0 flex justify-center items-center">
<hanko-auth />
</div>
);
}

export default Login;






In the above code, we authenticate without even using an backend server, simply using hanko.io . The provides a frontend block which helps the user to login and also signin it he/she doesn't has an account. It authenticates does email verfication by sending OTP to the user's email. It also provides the feature of login even if the user forgets his password and also provides 2-factor authentication using passkeys and also using device's biometrics .You can also other social authentication methods like google,facebook,github etc.



Here, we also get jwt tokens which can be further used in other routes to check the user's autheticity using the JWKS URL. We will be able to do all these stuff without even having a backend server.



Step 7: Handling Logout



To allow users to log out, we can just add a logout button in the further pages of the website.




import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { Hanko } from "@teamhanko/hanko-elements";

const hankoApi = process.env.REACT_APP_HANKO_API_URL;

function Logout() {
const navigate = useNavigate();
const [hanko, setHanko] = useState(<Hanko />);

useEffect(() => {
import("@teamhanko/hanko-elements").then(({ Hanko }) =>
setHanko(new Hanko(hankoApi ?? ""))
);
}, []);

const logout = async () => {
try {
await hanko?.user.logout();
navigate("/");
} catch (error) {
console.error("Error during logout:", error);
}
};

return (
<button onClick={logout} className="mt-10 bg-red-50 w-24 text-2xl hover:text-3xl hover:text-red-400 duration-300">Logout</button>
);
}

export default Logout






This is just an example how you can use the logout component in your website. As you can see that we can logout easily just using simple functions.



My Experience



I personally loved hanko.io because first of all, it has made my work very easy and also when I read the docs, it is super easy to understand and use. Most of the code which will be used in development process is already mentioned in the docs and so it makes our work very easy.



Secondly, there are a lot of options to use it like we can use it with other frontend frameworks like Vue, Angular, Svelte etc. We can also with many languages with which backend servers are written like NodeJs, Go, Python, Rust etc. So this makes it very compatible with every language. We can also use it with other frameworks like NextJs, Remix, Nuxt etc.



When I first visited their website, I found it to be very professional and easy to navigate. If someone just follows it step by step then it is super easy to understand and use.



With this blog, developers can understand how to integrate a modern and secure authentication system using Hanko in their projects, ensuring robust security while enhancing the user experience.



For more information you can visit hanko.io

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Easy Authentication Using Hanko.io
id: 23604edc-6f51-4ec3-84e5-7b3561bd412c
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-27
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-27"
        description = "YARA Signature for "
    strings:
        $str = "Easy Authentication Using Hank" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Easy Authentication Using Hankoio")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Easy Authentication Using Hankoio*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Easy Authentication Using Hankoio"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Analyse für identifizierte Bedrohung auf Basis von Live-CTI (ENISA EUVD): CVSS 0.0 · EPSS 0.0% · CISA KEV: nein. Handlungsableitung aus den verlinkten Hersteller-Quellen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Easy Authentication Using Hanko.io

Thematisch verwandte Begriffe: Easy, Authentication, Using, Hankoio · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100739 | A vulnerability was detected in mathurvishal CloudClassroom-PHP-Project…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag