我需要在Alfresco Share上下文中创建一个无需身份验证即可访问的页面。在使用页面框架时,它看起来非常简单,因为您可以将<authentication>none</authentication>添加到页面定义中。
在使用aikau时,页面定义消失了,只剩下get.des.xml-webscript文件,据我所知,该文件不支持身份验证元素。有谁有主意吗?
发布于 2015-12-25 19:35:54
看起来你正在通过auth-page url访问你的webscript:
http://<ip>:<port>/<context>/page/ap/ws/<webscript>需要注意的是,URL中的ap代表目录下定义的鉴权页面:
/<project-name>/src/main/webapp/WEB-INF/surf-config/pages/auth-page.xml本节内容:
<config evaluator="string-compare" condition="UriTemplate">
<uri-templates>
<uri-template id="remote-node-page">/{pageid}/p/{pagename}/{store_type}/{store_id}/{id}</uri-template>
<uri-template id="remote-site-page">/site/{site}/{pageid}/p/{pagename}</uri-template>
<uri-template id="remote-page">/{pageid}/p/{pagename}</uri-template>
<uri-template id="sitepage">/site/{site}/{pageid}/ws/{webscript}</uri-template>
<uri-template id="userpage">/user/{userid}/{pageid}/ws/{webscript}</uri-template>
<uri-template id="page">/{pageid}/ws/{webscript}</uri-template> <!-- this template matches your URI which means the resolution of which page/webscript would be accessed will rely fully on it -->
</uri-templates>
</config>您的
/<project-name>/src/main/webapp/WEB-INF/surf.xml基于URI模板定义页面/webscript解析策略。有关如何设置/利用页面uri模板的更多信息,请访问this tutorial
auth-page的身份验证设置为USER,如here所示,这将导致在尝试解析set脚本之前要求进行身份验证
因此,如果你想以未认证模式访问一些aikau页面(作为访客用户),你应该像这样使用noauth-page:
http://<ip>:<port>/<context>/page/na/ws/<webscript>仅供参考:您根本不必设置webscript身份验证,因为当身份验证标签不存在时,它将默认设置为none
发布于 2016-03-07 21:48:28
值得注意的是,您可以为Aikau创建自己的模板页面。您并不局限于共享中定义的页面,也不限于通过Aikau Maven原型创建的客户端(请参阅https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Tutorial1.md)。
例如,在共享中,您有4个开箱即用的模板:
在由Aikau Maven原型创建的客户端中,您有:- na (未经过身份验证)-呈现页面,但不要求用户进行身份验证- ap (Aikau Page) -为经过身份验证的用户呈现页面。
请参阅原型项目中的示例以供参考,无身份验证页面定义为here
此页面和标准身份验证页面都重用了最终映射到standard page FreeMarker template的standard template type
但是,如果您想要构建自己的页面和模板,您可以-您不限于使用默认提供的内容。
https://stackoverflow.com/questions/28715706
复制相似问题