Skip to content

zjyl1994/arkauthn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArkAuthn

方舟认证,兼容 ForwardAuth 规范的认证服务。 可以兼容 Caddy 等实现了ForwardAuth的Web服务,基于 JWT 进行认证。

安装

  1. 复制 setup/arkauthn.json/etc/arkauthn.json
  2. 复制 setup/arkauthn.service/etc/systemd/system/arkauthn.service
  3. 运行 systemctl daemon-reload
  4. 运行 systemctl enable arkauthn
  5. 运行 systemctl start arkauthn

Caddy 配置

auth.example.com {
    reverse_proxy http://localhost:9008
}
protect.example.com {
    forward_auth http://localhost:9008 {
        uri /api/forward-auth
    }
    respond "Protected Content"   
}

JWT

JWT Payload 格式为:

{
  "user": "zjyl1994",
  "exp": 1746549524,
  "nbf": 1746545924,
  "iat": 1746545924
}

HS256 签名,密钥使用 arkauthn.json 中对应用户的 Password 字段。

根据需要可生成更长时间的 JWT 使用。

支持的Token位置

位置 字段
Header X-Arkauthn: <token>
Cookie arkauthn=<token>
Query arkauthn=<token>

About

简单的ForwardAuth认证系统

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published