我对SSO和Shibboleth都是新手。
我已经在Apache服务器上成功地实现了Shibboleth SP。每当用户试图访问受保护的资源时,用户都会根据IDP进行身份验证。
基本上,Shibboleth SSO有以下6个步骤:
我的客户端应用程序纯粹是使用AngularJS 1.6开发的。
直到第六步,一切都很顺利。我的问题是:
步骤6中的:如何在我的AngularJS客户端应用程序中访问Shibboleth属性(例如名字或姓氏)?或者可以在AngularJS应用程序中直接访问这些属性吗?
Shibboleth没有提到使用AngularJS访问属性。
请。任何帮助,指导,建议,建议,反馈,我们将非常感激。
更新
httpd.conf
我的httpd.conf非常简单。我为Shibboleth做的唯一额外配置如下所示。Rest一切都是默认的。
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so
ServerName 10.63.32.125
<Location /licweb>
AuthType shibboleth
Require valid-user
ShibRequireSession On
ShibUseHeaders On
</Location>shibboleth2.xml
这也是一个非常简单的文件。
<SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" clockSkew="180">
<ApplicationDefaults entityID="https://www.example.com/licweb/shibboleth" REMOTE_USER="eppn persistent-id targeted-id">
<Sessions lifetime="28800" timeout="3600" checkAddress="false" relayState="ss:mem" handlerSSL="false">
<SSO entityID="https://my-sso-url">
SAML2 SAML1
</SSO>
<Logout>SAML2 Local</Logout>
<md:ArtifactResolutionService Location="/Artifact/SOAP" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
<Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
<Handler type="Status" Location="/Status" acl="127.0.0.1"/>
<Handler type="Session" Location="/Session" showAttributeValues="true" />
</Sessions>
<Errors supportContact="ankit.prajapati@yahoo.com" logoLocation="/shibboleth-sp/logo.jpg" styleSheet="/shibboleth-sp/main.css"/>
<MetadataProvider type="XML" file="MetaData.xml"/>
<AttributeExtractor type="XML" validate="true" path="attribute-map.xml"/>
<AttributeResolver type="Query" subjectMatch="true"/>
<AttributeFilter type="XML" validate="true" path="attribute-policy.xml"/>
<CredentialResolver type="File" key="sp-key.pem" certificate="sp-cert.pem"/>
</ApplicationDefaults>
<SecurityPolicyProvider type="XML" validate="true" path="security-policy.xml"/>
<ProtocolProvider type="XML" validate="true" reloadChanges="false" path="protocols.xml"/>
</SPConfig>会话
我还在URL:http://10.63.32.125/Shibboleth.sso/Session上获得了会话
Miscellaneous
Session Expiration (barring inactivity): 473 minute(s)
Client Address: 10.63.32.125
SSO Protocol: urn:oasis:names:tc:SAML:2.0:protocol
Identity Provider: https://my-identity-provider
Authentication Time: 2018-06-21T19:19:16.937Z
Authentication Context Class: urn:oasis:names:tc:SAML:2.0:ac:classes:AuthenticatedTelephony
Authentication Context Decl: (none)
Attributes
displayName: Doe,John
givenName: John
mail: john.doe@yahoo.com
persistent-id: https://my-persistent-id
sn: doe我想在运行在URL:http://10.63.32.125/licweb上的http://10.63.32.125/licweb客户端网站上访问这个属性
任何帮助都将不胜感激。谢谢。
发布于 2018-06-22 05:08:10
我认为您不能直接访问角js中的属性。您可能需要一些服务器端支持(在java使用servlet的情况下)来读取属性。
有关信息,请参阅相关的thread。
发布于 2019-10-03 12:25:46
通过在Session Handler中将contentType设置为application/json,您将得到一个JSON对象,而不是位于/Shibboleth.sso/Session的/Shibboleth.sso/Session。您可以像其他任何JavaScript资源/ REST应用程序一样,在客户端JSON应用程序中请求这个请求。
<Handler type="Session" Location="/Session" showAttributeValues="true" contentType="application/json" />请参阅https://wiki.shibboleth.net/confluence/display/SP3/Session+Handler
发布于 2018-06-21 17:50:56
当响应从IdP返回时,属性位于标头内。要访问它们,您必须启用受保护位置上的shibboleth标头:
<Location /SECUREPATH >
AuthType shibboleth
ShibRequireSession On
ShibUseHeaders On
Require valid-user
</Location>您将能够通过javascript中的头访问这些参数。但是欺骗可能会发生https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSpoofChecking
这就是我们访问头部的方式。我们使用Shibboleth作为自己的apache服务器:
如何访问apache中的客户头:how to access custom header value in apache?
https://stackoverflow.com/questions/50953083
复制相似问题