我正在使用SAML2和ADFS2(IdP)创建SSO“概念验证”。登录功能正常工作,但是ADFS2要求我的注销请求被签名(使用私钥),然后我想在ADFS2的Relying Party Trusts下的Signature选项卡中添加相同的证书(.cer文件)。唯一的问题是我的应用程序(服务提供商)没有证书。我知道我可以为此目的创建自签名证书,但似乎无法弄清楚如何创建所需的所有内容。
apt-get install openssl
Centos/RedHat:
yum install openssl
然后按照以下3个步骤进行操作:openssl genrsa -out server.pem 2048
2. 生成CSR:(在“通用名称”中设置您的服务提供商应用程序的域)
openssl req -new -key server.pem -out server.csr
3. 生成自签名证书
openssl x509 -req -days 365 -in server.csr -signkey server.pem -out server.crt
完成后,您将获得server.csr(证书签名请求)、server.pem(私钥)和server.crt(自签名证书)我在制作ADFS概念验证时,使用了Windows的SelfSSL工具。特别是这位博主为IIS7开发的增强版本。
示例命令:
selfssl7.exe /N cn=www.example.com /K 2048 /V 3652 /X /F C:\example.pfx /W foo
openssl req -new -x509 -key privateKey.pem -out cert.cer -days 365
从私钥创建一个.cer格式文件。 - tony.0919