-->

如何访问Shibboleth的SP在AngularJS应用程序属性(How to access Sh

2019-09-29 09:21发布

我是新来的SSO以及Shibboleth的。

我已经成功实施的Shibboleth SP Apache服务器上。 每当用户试图访问受保护的资源的用户是越来越认证对IDP。

基本上,Shibboleth的SSO具有以下6个步骤:

  1. 用户访问受保护的资源
  2. SP确定IDP和问题验证请求
  3. 用户验证到IdP进行
  4. 的IdP问题回应SP
  5. 回到SP
  6. 回到保护资源

我的客户端应用程序使用AngularJS 1.6纯粹的开发。

一切正常,直到第6步:我的问题是:

第6步:如何访问Shibboleth的SP在我AngularJS客户端应用的名字或姓氏等属性? 或者是它甚至有可能直接访问这些属性在AngularJS应用程序?

Shibboleth的维基没有提及访问使用AngularJS属性的东西。

请。 任何帮助| 指导| 建议| 反馈将不胜感激。

[UPDATE]

httpd.conf文件

我的httpd.conf中是非常简单的。 唯一的额外配置我做了Shibboleth的是如下。 其余的一切都是默认的。

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>

会议

我也得到了会议的网址: 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

我想访问该属性对我AngularJS客户网站在URL上运行: http://10.63.32.125/licweb

任何帮助将不胜感激。 谢谢。

Answer 1:

我不认为你可以直接从角JS访问的属性。 您可能需要一些服务器端支持( ajp中的情况下java使用servlet )读取属性。

请参阅相关的线程的一些信息。



Answer 2:

属性住在响应来自背部的IdP头内。 要访问他们,你将不得不以启用受保护的位置的陈词滥调标题:

<Location /SECUREPATH >
    AuthType shibboleth
    ShibRequireSession On
    ShibUseHeaders On
    Require valid-user
</Location>

您可以通过标题来访问您的JavaScript的参数。 但欺骗可能发生https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSpoofChecking

这是我们有机会获得我们的标题的方式。 我们使用的Shibboleth作为它自己的Apache服务器:

  • 用户访问/安全路径

  • Shibboleth的重定向国内流离失所者

  • 的IdP回来,以确保其路径可以看到的。 Apache的重定向/安全的地方,我们有一个回调,并通过URL访问属性我们的Web服务器。 但是,我们加密的URL,以确保它来自于我们。 我也有ShibUseHeaders关闭

我怎么访问的apache客户标题: 如何在Apache访问自定义标题价值?

我如何加密属性: 多个值RewriteMap指令PRG



文章来源: How to access Shibboleth SP Attributes in AngularJS Application