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

推荐订阅源

L
LINUX DO - 最新话题
T
Tor Project blog
G
GRAHAM CLULEY
S
Security Affairs
P
Palo Alto Networks Blog
TaoSecurity Blog
TaoSecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
aimingoo的专栏
aimingoo的专栏
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 三生石上(FineUI控件)
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CERT Recently Published Vulnerability Notes
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Check Point Blog
宝玉的分享
宝玉的分享
Forbes - Security
Forbes - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
H
Heimdal Security Blog
Recorded Future
Recorded Future
L
LangChain Blog
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
B
Blog
H
Help Net Security
T
Tailwind CSS Blog
The Hacker News
The Hacker News
雷峰网
雷峰网
P
Proofpoint News Feed
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
有赞技术团队
有赞技术团队
S
Schneier on Security
T
Troy Hunt's Blog
云风的 BLOG
云风的 BLOG
Hacker News - Newest:
Hacker News - Newest: "LLM"
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed

博客园 - 黄洪波

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