只是想知道是否有人可以在 joss-agent-config.xml 中向我展示如何与 JOSSO 的合作伙伴应用程序一起工作的示例?
2 回答
今天刚刚解决了这个问题。要为 JOSSO ignore-url-patterns 标签设置 URL 模式,您需要使用来自另一个命名空间的标签:
<agent:partner-app context="/" id="Liferay">
<agent:ignore-url-patterns>
<s:value>*.css</s:value>
<s:value>*.js</ s:value>
<s:value>*.gif</s:value>
<s:value>*.jpg</s:value>
<s:value>*.png</s:value>
</agent:忽略 url-patterns>
</agent:partner-app>
这假设您有 xmlns:agent="urn:org:josso:agent:core" 和 xmlns:s="http://www.springframework.org/schema/beans"。
ignore-url-patterns 的 XSD 使用“##other”范围,因此它必须是来自另一个命名空间的标记。我使用了 spring 的 <value /> 标签,因为它是一个简单的字符串容器,可以很好地保存您想要使用的各种 url 模式。
<configuration>
<agent:agent-configuration>
<!-- ============================================================================= -->
<!-- -->
<!-- JOSSO Parnter application definicions : -->
<!-- -->
<!-- Configure all web applications that should be a josso partner application -->
<!-- within this server. -->
<!-- For each partner application you have to define the proper web-context. -->
<!-- ============================================================================= -->
<agent:partner-apps>
<agent:partner-app id="AdminApp" context="/admin"/>
<agent:partner-app id="HOME" context="/home" >
<ignore-web-resource-collections>public-resources,img-resources</ignore-web-resource-collections>
</agent:partner-app>
<agent:partner-app id="EmployeeApp" context="/emp"/>
<agent:partner-app id="AuditApp" context="/audit"/>
</agent:partner-apps>
</agent:agent-configuration>