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

推荐订阅源

B
Blog
I
InfoQ
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
博客园_首页
The Cloudflare Blog
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
罗磊的独立博客
月光博客
月光博客
V
V2EX
大猫的无限游戏
大猫的无限游戏
腾讯CDC
GbyAI
GbyAI
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
B
Blog RSS Feed
Webroot Blog
Webroot Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
C
CERT Recently Published Vulnerability Notes
人人都是产品经理
人人都是产品经理
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recent Announcements
Recent Announcements
Cyberwarzone
Cyberwarzone
G
Google Developers Blog
H
Heimdal Security Blog
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
T
Tenable Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
O
OpenAI News
C
Check Point Blog
Forbes - Security
Forbes - Security
SecWiki News
SecWiki News
K
Kaspersky official blog
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Full Disclosure
阮一峰的网络日志
阮一峰的网络日志

博客园 - 黄洪波

安装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认证登录,也可以使用本地登录。