mirror of
https://gitee.com/huanghongxun/HMCL-docs.git
synced 2026-03-19 08:15:26 +08:00
7 lines
7.7 KiB
HTML
7 lines
7.7 KiB
HTML
<!doctype html><html lang="zh" class="no-js"><head><meta charset="utf-8"><title>Authlib-Injector 服务器设置指南 - HMCL 文档</title><meta name="description" content="配置默认的验证服务器"><meta property="og:type" content="article"><meta property="og:locale" content="zh"><meta property="og:site_name" content="HMCL 文档"><meta property="og:title" content="Authlib-Injector 服务器设置指南"><meta property="og:url" content="https://docs.hmcl.net/launcher/authlib-injector.html"><meta property="og:description" content="配置默认的验证服务器"><meta property="article:published_time" content="2021-08-22T23:18:02+08:00"><link rel="canonical" href="https://docs.hmcl.net/launcher/authlib-injector.html"><link href="/feed.xml" type="application/atom+xml" rel="alternate" title="HMCL 文档 Feed"><meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; window.enable_copy_code_button = true; </script><link rel="stylesheet" href="/assets/css/main.css"><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"> <noscript><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"></noscript> <script src="/assets/js/settings.js"></script> <script src="/assets/js/theme.js"></script><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" id="skin"></head><body class="layout--document" dir="ltr"><nav class="skip-links"><ul><li><a href="#site-nav" class="screen-reader-shortcut">转到主导航栏</a></li><li><a href="#main" class="screen-reader-shortcut">转到内容</a></li><li><a href="#footer" class="screen-reader-shortcut">转到底部</a></li></ul></nav><div class="masthead"><div class="masthead__inner-wrap"><div class="masthead__menu"><nav id="site-nav" class="greedy-nav"> <a class="site-logo" href="/"><img src="/assets/img/hmcl.png" alt="HMCL 文档"></a> <a class="site-title" href="/"> HMCL 文档 </a><ul class="visible-links"><li class="masthead__menu-item"> <a href="/settings.html" >设置</a></li></ul><button class="greedy-nav__toggle hidden" type="button"> <span class="visually-hidden">切换菜单</span><div class="navicon"></div></button><ul class="hidden-links hidden"></ul></nav></div></div></div><div class="initial-content"><div id="main" role="main"><div class="sidebar sticky"><nav class="nav__list"> <input id="ac-toc" name="accordion-toc" type="checkbox" /> <label for="ac-toc">切换菜单</label><ul class="nav__items"><li> <span class="nav__sub-title">问题集合</span><ul><li><a href="/faq.html">常见问题</a></li><li><a href="/launcher/">启动器使用相关</a></li><li><a href="/modpack/">整合包帮助</a></li><li><a href="/multiplayer/">多人联机帮助</a></li></ul></li><li> <span class="nav__sub-title">使用者帮助</span><ul><li><a href="/launcher/isolation.html">版本隔离</a></li><li><a href="/launcher/offline-skin.html">设置离线皮肤</a></li><li><a href="/launcher/auto-installing.html">HMCL 的自动安装使用教程</a></li><li><a href="/launcher/shader.html">安装光影</a></li><li><a href="/launcher/set-item-details.html">设置项详解</a></li></ul></li><li> <span class="nav__sub-title">开发者帮助</span><ul><li><a href="/launcher/datapack.html">制作 HMCL 格式的数据包</a></li><li><a href="/modpack/serverpack.html">制作整合包</a></li><li><a href="/launcher/authlib-injector.html" class="active">添加默认 authlib-injector 验证服务器</a></li></ul></li><li> <span class="nav__sub-title">更新日志</span><ul><li><a href="/changelog/stable.html">稳定版</a></li><li><a href="/changelog/dev.html">开发版</a></li></ul></li><li> <span class="nav__sub-title">其他</span><ul><li><a href="/eula/hmcl.html">用户协议</a></li><li><a href="/contribution.html">贡献指南</a></li><li><a href="https://hmcl.huangyuhui.net">项目官网</a></li><li><a href="https://github.com/HMCL-dev/HMCL">项目仓库</a></li><li><a href="https://github.com/HMCL-dev/HMCL-docs">文档仓库</a></li></ul></li></ul></nav></div><article class="page" itemscope itemtype="https://schema.org/CreativeWork"><meta itemprop="headline" content="Authlib-Injector 服务器设置指南"><meta itemprop="description" content="配置默认的验证服务器"><meta itemprop="datePublished" content="2021-08-22T23:18:02+08:00"><div class="page__inner-wrap"><header><h1 id="page-title" class="page__title" itemprop="headline"> <a href="https://docs.hmcl.net/launcher/authlib-injector.html" itemprop="url">Authlib-Injector 服务器设置指南 </a></h1></header><section class="page__content" itemprop="text"><aside class="sidebar__right sticky"><nav class="toc"><header><h4 class="nav__title"><i class="fas fa-file-alt"></i> 目录</h4></header><ul class="toc__menu"><li><a href="#背景">背景</a></li><li><a href="#方法">方法</a></li></ul></nav></aside><img src="https://hits.zkitefly.eu.org/?tag=https%3A%2F%2Fdocs.hmcl.net%2Flauncher%2Fauthlib-injector.html" alt="Hits" decoding="async"><div class="notice--info"><p>本文由 huanghongxun 创建。</p></div><h2 id="背景">背景</h2><p>使用 authlib-injector 认证的服主可以通过本教程提供的方法使 HMCL 默认在打开时弹窗要求创建对应认证服务器的账户。</p><h2 id="方法">方法</h2><p>在 HMCL 启动器同级目录下创建 <code class="language-plaintext highlighter-rouge">authlib-injectors.json</code> 文件,此时文件夹目录结构如下图所示:</p><p><img src="/assets/img/docs/authlib-injector/image.png" alt=""></p><p>(注意,请确保打包后的整合包不包含 <code class="language-plaintext highlighter-rouge">hmcl.json</code> 文件,否则无法生效。该文件默认为隐藏状态,需开启隐藏文件显示)</p><p><code class="language-plaintext highlighter-rouge">authlib-injectors.json</code> 文件的示例如下</p><div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"urls"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
|
</span><span class="s2">"https://example.yggdrasil.yushi.moe/"</span><span class="w">
|
|
</span><span class="p">]</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div></div></section><footer class="page__meta"><p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> 更新时间:</strong> <time class="dt-published" datetime="2021-08-22T23:18:02+08:00">2021-08-22</time></p></footer><nav class="pagination"> <a href="#" class="pagination--pager disabled">上一页</a> <a href="/launcher/datapack.html" class="pagination--pager" title="数据包制作指南">下一页</a></nav></div></article></div></div><div id="footer" class="page__footer"><footer><div class="page__footer-follow"><ul class="social-icons"><li><strong>关注:</strong></li><li><a href="https://github.com/HMCL-dev/HMCL" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> Github</a></li><li><a href="https://beian.miit.gov.cn" rel="nofollow noopener noreferrer"><i class="fas fa-link" aria-hidden="true"></i> 粤ICP备18071565号</a></li><li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li></ul></div><div class="page__footer-copyright">© 2026 <a href="mailto:hmcl@huangyuhui.net">huanghongxun</a>. 技术来自于 <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/jekyll-themes/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a>.</div></footer></div><script src="/assets/js/main.min.js"></script> <script src="/assets/js/plugins/jquery.auto-redirect.js"></script></body></html>
|