{"id":9285,"date":"2026-08-09T15:36:44","date_gmt":"2026-08-09T13:36:44","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/"},"modified":"2026-08-09T15:36:44","modified_gmt":"2026-08-09T13:36:44","slug":"authentication-basic-auth-htpasswd-generator","status":"publish","type":"page","link":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/","title":{"rendered":"Authentifizierung: Basic Auth und htpasswd-Generator"},"content":{"rendered":"<div id=\"auth-tool-wrapper\" style=\"max-width: 100%; background: #1e293b; color: #f8fafc; padding: 28px; border-radius: 12px; font-family: system-ui, -apple-system, sans-serif; box-shadow: 0 4px 20px rgba(0,0,0,0.3); border: 1px solid #334155;\">\n<p>    <!-- Privacy Notice Banner --><\/p>\n<div style=\"display: flex; align-items: center; gap: 12px; background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.2); padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; font-size: 0.85rem; color: #38bdf8; line-height: 1.4;\">\n        <svg style=\"width: 20px; height: 20px; flex-shrink: 0;\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"><\/path><\/svg><br \/>\n        <span><strong>Datenschutz-Garantie:<\/strong> Keine der hier eingegebenen Daten wird auf meinem Server gespeichert oder anderweitig \u00fcbertragen. Alles l\u00e4uft zu 100 % lokal in Ihrem Browser.<\/span>\n    <\/div>\n<div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;\">\n<div>\n            <label style=\"display: block; font-size: 0.875rem; margin-bottom: 8px; color: #cbd5e1; font-weight: 500;\">Benutzername<\/label><br \/>\n            <input type=\"text\" id=\"auth-user\" placeholder=\"z. B. api_user\" style=\"width: 100%; padding: 12px; background: #0f172a; border: 1px solid #475569; color: #fff; border-radius: 8px; box-sizing: border-box; outline: none; transition: border-color 0.2s, box-shadow 0.2s;\" onfocus=\"this.style.borderColor='#38bdf8'; this.style.boxShadow='0 0 0 3px rgba(56,189,248,0.15)'\" onblur=\"this.style.borderColor='#475569'; this.style.boxShadow='none'\">\n        <\/div>\n<div>\n            <label style=\"display: block; font-size: 0.875rem; margin-bottom: 8px; color: #cbd5e1; font-weight: 500;\">Passwort<\/label><br \/>\n            <input type=\"text\" id=\"auth-pass\" placeholder=\"z. B. GeheimesPasswort123\" style=\"width: 100%; padding: 12px; background: #0f172a; border: 1px solid #475569; color: #fff; border-radius: 8px; box-sizing: border-box; outline: none; transition: border-color 0.2s, box-shadow 0.2s;\" onfocus=\"this.style.borderColor='#38bdf8'; this.style.boxShadow='0 0 0 3px rgba(56,189,248,0.15)'\" onblur=\"this.style.borderColor='#475569'; this.style.boxShadow='none'\">\n        <\/div>\n<\/p><\/div>\n<p>    <button id=\"auth-generate-btn\" style=\"width: 100%; background: #0284c7; color: white; border: none; padding: 12px; font-weight: 600; font-size: 0.95rem; border-radius: 8px; cursor: pointer; transition: background 0.2s, transform 0.1s;\" onmouseover=\"this.style.background='#0369a1'\" onmouseout=\"this.style.background='#0284c7'\" onmousedown=\"this.style.transform='scale(0.99)'\" onmouseup=\"this.style.transform='scale(1)'\">Zugangsdaten erzeugen<\/button><\/p>\n<div style=\"margin-top: 24px; display: flex; flex-direction: column; gap: 16px;\">\n        <!-- .htpasswd Output --><\/p>\n<div>\n<div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;\">\n                <label style=\"font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;\">1. Eintrag f\u00fcr die Datei .htpasswd (SHA)<\/label><br \/>\n                <button onclick=\"copyToClipboard('out-htpasswd', this)\" style=\"background: rgba(71, 85, 105, 0.4); border: 1px solid #475569; color: #cbd5e1; padding: 3px 10px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; transition: all 0.2s;\" onmouseover=\"this.style.background='#475569'; this.style.color='#fff'\" onmouseout=\"this.style.background='rgba(71, 85, 105, 0.4)'; this.style.color='#cbd5e1'\">Kopieren<\/button>\n            <\/div>\n<p>            <input type=\"text\" id=\"out-htpasswd\" readonly style=\"width: 100%; padding: 11px 12px; background: #0f172a; border: 1px solid #334155; color: #38bdf8; font-family: monospace; font-size: 0.9rem; border-radius: 6px; box-sizing: border-box;\" placeholder=\"[benutzername]:{SHA}[hash]\">\n        <\/div>\n<p>        <!-- Basic Auth Header Output --><\/p>\n<div>\n<div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;\">\n                <label style=\"font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;\">2. HTTP-Header (Authorization: Basic)<\/label><br \/>\n                <button onclick=\"copyToClipboard('out-header', this)\" style=\"background: rgba(71, 85, 105, 0.4); border: 1px solid #475569; color: #cbd5e1; padding: 3px 10px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; transition: all 0.2s;\" onmouseover=\"this.style.background='#475569'; this.style.color='#fff'\" onmouseout=\"this.style.background='rgba(71, 85, 105, 0.4)'; this.style.color='#cbd5e1'\">Kopieren<\/button>\n            <\/div>\n<p>            <input type=\"text\" id=\"out-header\" readonly style=\"width: 100%; padding: 11px 12px; background: #0f172a; border: 1px solid #334155; color: #38bdf8; font-family: monospace; font-size: 0.9rem; border-radius: 6px; box-sizing: border-box;\" placeholder=\"Basic [base64_credentials]\">\n        <\/div>\n<p>        <!-- cURL Example Output --><\/p>\n<div>\n<div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;\">\n                <label style=\"font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;\">3. cURL-Testbefehl<\/label><br \/>\n                <button onclick=\"copyToClipboard('out-curl', this)\" style=\"background: rgba(71, 85, 105, 0.4); border: 1px solid #475569; color: #cbd5e1; padding: 3px 10px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; transition: all 0.2s;\" onmouseover=\"this.style.background='#475569'; this.style.color='#fff'\" onmouseout=\"this.style.background='rgba(71, 85, 105, 0.4)'; this.style.color='#cbd5e1'\">Kopieren<\/button>\n            <\/div>\n<p>            <input type=\"text\" id=\"out-curl\" readonly style=\"width: 100%; padding: 11px 12px; background: #0f172a; border: 1px solid #334155; color: #38bdf8; font-family: monospace; font-size: 0.9rem; border-radius: 6px; box-sizing: border-box;\" placeholder=\"curl -u &quot;user:pass&quot; https:\/\/...\">\n        <\/div>\n<\/p><\/div>\n<\/div>\n<p><script>\nasync function generateAuthData() {\n    const user = document.getElementById('auth-user').value.trim();\n    const pass = document.getElementById('auth-pass').value.trim();<\/p>\n<p>    if (!user || !pass) {\n        alert('Bitte geben Sie Benutzername und Passwort ein.');\n        return;\n    }<\/p>\n<p>    const encoder = new TextEncoder();\n    const data = encoder.encode(pass);\n    const hashBuffer = await crypto.subtle.digest('SHA-1', data);\n    const hashArray = Array.from(new Uint8Array(hashBuffer));\n    const base64Hash = btoa(String.fromCharCode.apply(null, hashArray));<\/p>\n<p>    document.getElementById('out-htpasswd').value = `${user}:{SHA}${base64Hash}`;<\/p>\n<p>    const basicCreds = btoa(`${user}:${pass}`);\n    document.getElementById('out-header').value = `Basic ${basicCreds}`;<\/p>\n<p>    document.getElementById('out-curl').value = `curl -u \"${user}:${pass}\" https:\/\/your-domain.com\/endpoint`;\n}<\/p>\n<p>document.getElementById('auth-generate-btn').addEventListener('click', generateAuthData);\ndocument.getElementById('auth-pass').addEventListener('keypress', function (e) {\n    if (e.key === 'Enter') generateAuthData();\n});<\/p>\n<p>function copyToClipboard(elementId, btnElement) {\n    const copyText = document.getElementById(elementId);\n    if (!copyText.value) return;<\/p>\n<p>    navigator.clipboard.writeText(copyText.value).then(() => {\n        const originalText = btnElement.innerText;\n        btnElement.innerText = 'Kopiert!';\n        btnElement.style.color = '#38bdf8';\n        btnElement.style.borderColor = '#38bdf8';\n        btnElement.style.background = 'rgba(56, 189, 248, 0.1)';\n        setTimeout(() => {\n            btnElement.innerText = originalText;\n            btnElement.style.color = '#cbd5e1';\n            btnElement.style.borderColor = '#475569';\n            btnElement.style.background = 'rgba(71, 85, 105, 0.4)';\n        }, 1500);\n    });\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Erzeugt aus Benutzername und Passwort einen .htpasswd-Eintrag, den Authorization-Header f\u00fcr Basic Auth und einen passenden cURL-Testbefehl \u2013 vollst\u00e4ndig lokal im Browser.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":9283,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-tool-base.php","meta":{"footnotes":""},"class_list":["post-9285","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog\" \/>\n<meta property=\"og:description\" content=\"Erzeugt aus Benutzername und Passwort einen .htpasswd-Eintrag, den Authorization-Header f\u00fcr Basic Auth und einen passenden cURL-Testbefehl \u2013 vollst\u00e4ndig lokal im Browser.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/08\/og-default.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/de\\\/werkzeuge\\\/authentication-basic-auth-htpasswd-generator\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/de\\\/werkzeuge\\\/authentication-basic-auth-htpasswd-generator\\\/\",\"name\":\"Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-08-09T13:36:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/de\\\/werkzeuge\\\/authentication-basic-auth-htpasswd-generator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/de\\\/werkzeuge\\\/authentication-basic-auth-htpasswd-generator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/de\\\/werkzeuge\\\/authentication-basic-auth-htpasswd-generator\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Toolbox\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/toolbox-2\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Authentifizierung: Basic Auth und htpasswd-Generator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"luky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"luky\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/","og_locale":"en_US","og_type":"article","og_title":"Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog","og_description":"Erzeugt aus Benutzername und Passwort einen .htpasswd-Eintrag, den Authorization-Header f\u00fcr Basic Auth und einen passenden cURL-Testbefehl \u2013 vollst\u00e4ndig lokal im Browser.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/","og_site_name":"Lukas Wojcik - Blog","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/08\/og-default.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/","url":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/","name":"Authentifizierung: Basic Auth und htpasswd-Generator - Lukas Wojcik - Blog","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"datePublished":"2026-08-09T13:36:44+00:00","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/de\/werkzeuge\/authentication-basic-auth-htpasswd-generator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Toolbox","item":"https:\/\/www.lukaswojcik.com\/blog\/toolbox-2\/"},{"@type":"ListItem","position":3,"name":"Authentifizierung: Basic Auth und htpasswd-Generator"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"luky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"luky"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/9285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=9285"}],"version-history":[{"count":0,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/9285\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/9283"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=9285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}