惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 黄洪波

安装openclaw 排查项目中依赖的mybatis 拦截器 ModelAttribute 老革命遇上新问题 使用calcite构造ddl建表语句 OpenWebUI单点登录之解决动态参数问题 IDEA自带的Maven 3.9.x无法刷新http nexus私服(转) windows docker安装rocketmq之踩坑记 分布式系统设计经典论文(转载) 训练自己的yolo-v11数据集(二) 训练自己的yolo-v11数据集(一) 本地使用pycharm进行yolo推理 2024年的云原生架构需要哪些技术栈 (转) yolo v11学习,入门篇 - 黄洪波 AI工具验证 解决Win10无法进入睡眠模式(转) idea常用插件 内网离线模式下激活JRebel java导入json数据至doris 将SpringBoot打包之后的jar设为守护进程
OpenWebUI单点登录之深坑
黄洪波 · 2024-12-28 · via 博客园 - 黄洪波

OpenWebUI单点登录:官方文档:https://docs.openwebui.com/features/sso

此单点登录方案使用的是Trusted Header方案,意思就是在登录的时候,header里面要带上X-User-Email,X-User-Name,自动单点登录。

Docker启动命令

docker run -d -p 3001:8080  -e WEBUI_AUTH_TRUSTED_EMAIL_HEADER=X-User-Email -e WEBUI_AUTH_TRUSTED_NAME_HEADER=X-User-Name  -v open-webui1:/app/backend/data --name open-webui-1 ghcr.io/open-webui/open-webui:main

nginx配置内容

server {
    listen 80;
    server_name owl.tyl.com;

    # 配置访问日志
    access_log C:/nginx-1.26.2/logs/owl.tyl.com.access.log;

    location / {
        set $email "";
        set $name "";

        if ($arg_email) {
            set $email $arg_email;
        }

        if ($arg_name) {
            set $name $arg_name;
        }
    
    
        proxy_pass http://127.0.0.1:3001;  # 后端服务地址
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        
        # 添加自定义请求头
        proxy_set_header X-User-Email "dufan@z.com";
        proxy_set_header X-User-Name "dufan";
        # 添加自定义请求头
        #proxy_set_header X-User-Email $email;
        #proxy_set_header X-User-Name $name;
    }
    
}

是否必须使用HOST我还需要再测试测试,毕竟后面有个警告内容  HOST 127.0.0.1

坑1:

文档第一段这个结构让我误以为只有OAuth2需要配置这个参数,没想到是个全局参数。

 坑2:自动生成账户

ENABLE_OAUTH_SIGNUP - if true, allows accounts to be created when logging in with OAuth.

让我误以为,只要配置了这个参数之后,X-User-Name对应的账号会自动创建,没想到还是要手动创建,见坑3.

 坑3:第一个账号默认为管理员,其余账号需要手动创建

 使用quick start方式启动成功之后,第一次访问127.0.0.1:3000会要求创建一个管理员账户,使用Trusted Header方式会将该第一个账户设置为管理员(待与坑4一起验证)

坑4:不能一上来就用Trusted Header模式启动服务,必须先使用普通的quick start模式启动服务之后,创建好管理员账户,否则后续缺少管理员。

但是管理员账户又不能使用密码登录,怎么办呢,管理员账号也只能通过Trusted Header的模式代理登录。登录管理员之后再创建其他用户或者其他管理员账户。(待和坑3一起验证)

坑5:配置了Trused Header模式之后,ldap登录方式和本地登录模式都会失效。

方案2

配置LDAP统一密码登录,配置之后既可以使用ldap认证登录,也可以使用本地登录。