要求

要想使用 ADFS 登陆到 Seafile,需要以下组件:

1、安装了 ADFS 的windows服务器。安装 ADFS 和相关配置详情请参考 本文。

2、对于 ADFS 服务器的SSL有效证书,在这里我们使用 adfs-server.adfs.com 作为域名示例。

3、对于 seafile 服务器的SSL有效证书,在这里我们使用 demo.seafile.com 作为域名示例。

准备证书文件

1、SP(Service Provider) 的 x.509 证书

可以通过以下方式获取:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout sp.key -out sp.crt

x.509 证书用来签署和加密诸如SAML的NameID和Metadata等元素。

然后将这两个文件复制到 /seahub-data/certs。如果证书文件夹不存在,请创建它。

2、IdP(Identity Provider) 的 x.509 证书

登陆到 ADFS 服务器并且打开 ADFS 管理。

双击 Service 并选择 Certificates。

导出 Token-Signing 证书:

右击证书并选择 View Certificate。

选择 Details 选项卡。

单击 Copy to File (选择 DER encoded binary X.509)。

将此证书转换为PEM格式,重命名为 idp.crt

复制它到 /seahub-data/certs。

准备 IdP 元数据文件

在 seafile 服务器上安装

对于 Ubuntu 16.04

sudo apt install libxmlsec1

sudo pip install cryptography djangosaml2

配置seafile

添加以下配置到 seahub_settings.py

from os import path

import saml2

import saml2.saml

CERTS_DIR = '/seahub-data/certs'

SP_SERVICE_URL = 'https://demo.seafile.com'

XMLSEC_BINARY = '/usr/local/bin/xmlsec1'

ATTRIBUTE_MAP_DIR = '/seafile-server-latest/seahub-extra/seahub_extra/adfs_auth/attribute-maps'

SAML_ATTRIBUTE_MAPPING = {

'DisplayName': ('display_name', ),

'ContactEmail': ('contact_email', ),

'Deparment': ('department', ),

'Telephone': ('telephone', ),

}

ENABLE_ADFS_LOGIN = True

EXTRA_AUTHENTICATION_BACKENDS = (

'seahub_extra.adfs_auth.backends.Saml2Backend',

)

SAML_USE_NAME_ID_AS_USERNAME = True

LOGIN_REDIRECT_URL = '/saml2/complete/'

SAML_CONFIG = {

# full path to the xmlsec1 binary programm

'xmlsec_binary': XMLSEC_BINARY,

'allow_unknown_attributes': True,

# your entity id, usually your subdomain plus the url to the metadata view

'entityid': SP_SERVICE_URL + '/saml2/metadata/',

# directory with attribute mapping

'attribute_map_dir': ATTRIBUTE_MAP_DIR,

# this block states what services we provide

'service': {

# we are just a lonely SP

'sp' : {

"allow_unsolicited": True,

'name': 'Federated Seafile Service',

'name_id_format': saml2.saml.NAMEID_FORMAT_EMAILADDRESS,

'endpoints': {

# url and binding to the assetion consumer service view

# do not change the binding or service name

'assertion_consumer_service': [

(SP_SERVICE_URL + '/saml2/acs/',

saml2.BINDING_HTTP_POST),

],

# url and binding to the single logout service view

# do not change the binding or service name

'single_logout_service': [

(SP_SERVICE_URL + '/saml2/ls/',

saml2.BINDING_HTTP_REDIRECT),

(SP_SERVICE_URL + '/saml2/ls/post',

saml2.BINDING_HTTP_POST),

],

},

# attributes that this project need to identify a user

'required_attributes': ["uid"],

# attributes that may be useful to have but not required

'optional_attributes': ['eduPersonAffiliation', ],

# in this section the list of IdPs we talk to are defined

'idp': {

# we do not need a WAYF service since there is

# only an IdP defined here. This IdP should be

# present in our metadata

# the keys of this dictionary are entity ids

'https://adfs-server.adfs.com/federationmetadata/2007-06/federationmetadata.xml': {

'single_sign_on_service': {

saml2.BINDING_HTTP_REDIRECT: 'https://adfs-server.adfs.com/adfs/ls/idpinitiatedsignon.aspx',

},

'single_logout_service': {

saml2.BINDING_HTTP_REDIRECT: 'https://adfs-server.adfs.com/adfs/ls/?wa=wsignout1.0',

},

},

},

},

},

# where the remote metadata is stored

'metadata': {

'local': [path.join(CERTS_DIR, 'idp_federation_metadata.xml')],

},

# set to 1 to output debugging information

'debug': 1,

# Signing

'key_file': '',

'cert_file': path.join(CERTS_DIR, 'certs/idp.crt'), # from IdP

# Encryption

'encryption_keypairs': [{

'key_file': path.join(CERTS_DIR, 'certs/sp.key'), # private part

'cert_file': path.join(CERTS_DIR, 'certs/sp.crt'), # public part

}],

'valid_for': 24, # how long is our metadata valid

}

配置 ADFS 服务

添加 Relying Party Trust

Relying Party Trust 是 Seafile 和 ADFS 之间的连接。

登陆到 ADFS 服务器并打开 ADFS 管理界面。

双击 Trust Relationships,然后右键 Relying Party Trusts,选择 Add Relying Party Trust…。

选择 Import data about the relying party published online or one a local network,在 Federation metadata address 中输入 https://demo.seafile.com/saml2/metadata/

然后 Next 直到 Finish。

添加 Relying Party Claim Rules

Relying Party Claim Rules 是用于windows域中seafile和用户的通信。

Important:在windows域中的用户必须要设置了 E-mail 值。

右键点击 relying party trust 并且选择 Edit Claim Rules…。

在 Issuance Transform Rules Add Rules…

选择 Send LDAP Attribute as Claims 作为申请规则模版来用。

给 claim 一个名称,例如:LDAP Attributes。

将 Attribute Store 设置为 Active Directory,LDAP Attribute 设置为 E-Mail-Addresses,Outgoing Claim Type 设置为 E-mail Address。

选择 Finish。

再次单击 Add Rule…。

选择 Transform an Incoming Claim。

给它一个名字例如:Email to Name ID。

输入的 claim 类型应该是 E-mail Address (它必须跟 rule #1 中的Outgoing Claim Type 相匹配)。

Outgoing claim 的类型是 Name ID (这是seafile配置策略中的要求 'name_id_format': saml2.saml.NAMEID_FORMAT_EMAILADDRESS)。

Outgoing name ID 格式为 Email。

通过所有的 claim 的值 并且单击 Finish。

测试

重启服务后,你可以打开一个web浏览器并且输入 https://demo.seafile.com,在登陆对话框中应该有一个 adfs 按钮。单击该按钮将重定向到 ADFS 服务器(adfs-server.adfs.com),如果用户名密码正确,你将被重定向到seafile主页。

对于descktop客户端,只需要在”Add a new account”窗口点击”Shibboleth Login”,输入 https://demo.seafile.com,单击 OK 按钮将会打开一个新的窗口显示ADFS服务的登录页面,如果用户名和密码正确,窗口将关闭并显示seafile资料库面板。

ad文件服务器部署,AD 集成 – 配置 ADFS 登陆 - Seafile 服务器用户手册相关推荐

  1. seachange服务器装系统,其他部署说明 – 开机启动 Seafile - Seafile 服务器用户手册...

    对于运行 systemd 的系统 例如 Debian 8 以及更新的版本,Ubuntu 15.04以及更新的版本. 创建 systemd 服务管理文件,将以下示例中 ${seafile_dir} 替换 ...

  2. Azure实践系列 1:部署和基本配置Azure AD

    年末了,发现还有些好玩的东西可以分享,对于Azure来说真是抛砖引玉,冰山一角,但还是非常的有价值.今天分享的是在云端部署和配置活动目录服务,之后我们相当于就有了一个云AD,我们可以让云端的计算机加入 ...

  3. AD环境部署文件服务器2012,Windows_server_2012部署AD域及辅域环境.doc

    实用文案 标准文档 部署Windows server 2012 AD 实验环境: 操作系统 角色 IP地址 主机名 Windows server 2012 主域服务器 0 AD01 Windows s ...

  4. PKI/CA: Win2012 R2标准版 分布式部署AD域控环境的智能卡登陆配置问题记录_20180919_七侠镇莫尛貝

    概述: PC1: DNS + IIS + AD, Win2012 R2标准版 PC2: AD证书服务, Win2012 R2标准版, PC3: 智能卡(飞天ePass3000)登陆测试客户端. 1.P ...

  5. 部署SCVMM2012 SP1 集群(1)---部署AD

    一.实验环境介绍 实验环境拓扑图: AD.SCVMM主机操作系统均为Windows2012. SQL为SQL2008R2,操作系统Windows 2008R2 SCVMM为SCVMM 2012 SP1 ...

  6. Windows Server 2008中部署AD

    因安装Exchange需要有AD,这里也将部署AD的图片发上共享一下:) 1.打开服务器管理器,点击角色,添加角色 2.选中Active Directory域服务 3.等待一会就安装完成,接下来是配置 ...

  7. Windows 2012 R2 中 AD DS 部署

    提示:部署AD DS(Active Directory Domain Service)过程中,林,域或终端所有操作系统,建议不要采用GHOST.虚拟机克隆模式等相同复制操作,会产生SID相同的可能概率 ...

  8. 三、 vSphere 6.7 U1(三):部署AD和DNS

    1.添加一台虚拟机,用于部署AD和DNS服务器,依次单击"虚拟机"--->"创建/注册虚拟机",如果不需要用到AD,也可以的 2.在"选择创建类 ...

  9. WindownServer2016部署AD RMS(保护重要文档)

    博客目录 一.AD RMS是什么? 1.AD RMS简介 2.AD RMS群集概述 3.AD RMS客户端介绍 4.AD RMS环境为什么需要IIS? 5.AD RMS环境为什么需要数据库? 二.部署 ...

最新文章

  1. 无刷电机真威武,一通操作猛如虎
  2. 根据API创建BOM(Itpub)
  3. Python 列表(List)操作方法详解
  4. sql 删除用户失败
  5. oracle挂证多少钱一个月_惊呆,一条sql竟然把Oracle搞挂了
  6. 使用HazelCast进行休眠缓存:JPA缓存基础知识
  7. [react] 在React中怎么使用字体图标?
  8. Android应用【世界杯知识答题】的界面设计经验
  9. 价值358的emlog定制模板lu1.3
  10. 在 Linux、 FreeBSD、 OpenBSD等UNIX操作系统 中查看 所有安装的软件或包
  11. Emacs+Lisp环境搭建
  12. 【数据结构系列】严蔚敏C语言版算法实现并附带详细注释(逐步更新)
  13. GNS3(1.下载与安装)
  14. “携手共建互联网安全生态”研讨会在京召开
  15. matplotlib生成没有留白的图片
  16. pip(Python包管理工具)安装第三方库教程
  17. POJ 2924 Gauß in Elementary School(水~)
  18. Cloudberry Backup使用过程中的一些小问题
  19. Re-enable SSLv3 on Firefox 34
  20. 透视前端工程化之一:模板功能设计

热门文章

  1. 并发数据结构-1.1 并发的数据结构的设计
  2. 限制对web路径的访问
  3. 知方可补不足~数据库名称和数据库别名不同了怎么办
  4. 分类算法之决策树介绍
  5. 活动目录应用篇一:使用windows server 2008 backup备份AD是的账户权限问题
  6. laravel 集成采集_新版2020 Laravel采集网站程序
  7. Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlFmtTLV
  8. Hive的数据模型—桶表
  9. hibernate开发优缺点
  10. 帆软按钮控件变查询_帆软报表(多sheet)自定义分页查询