露天门票有效期
我正在使用 alfresco 默认 Web 脚本为用户获取票证,但我不确定获得的票证何时有效。
我还从 alfresco 默认登录 Web 脚本获得的 XML 响应中提取票证。
票证是否有有效期,或者一旦获得票证,它就不会在会话到期之前过期?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Alfresco 存储库上设置的以下属性及其默认值将票证有效期配置为一小时:
您可以在 通常的方式。有意义的值在 Duration 类:
请注意,默认情况下,成功使用票证将更新其有效性,这意味着如果您对 Web 脚本进行身份验证,则票证有效期为一小时称呼票券生成后59m后使用,其有效期将延长一小时。
由于票证生命周期是完全可配置的,因此请查看
authentication-services-context.xml
中定义的ticketComponent
Spring bean 以查看可用选项(例如设置oneOff
设置为 true 以仅允许给定票证使用一次)。The following property set on the Alfresco repository, along with its default value, configures the ticket life span to be one hour:
You can override such property in the usual way. Meaningful values are described in the Duration class:
Please note that by default successful usages of a ticket will renew its validity, meaning that given a ticket validity of one hour, if you authenticate, say, a web script call using the ticket after 59m from its generation, its validity will be extended to another hour.
As the ticket lifecycle is completely configurable, have a look at the
ticketComponent
Spring bean defined inauthentication-services-context.xml
to see the available options (e.g. settingoneOff
to true to only allow one single use of a given ticket).处理露天身份验证票证的最佳方法是手动处理。例如,要获取门票,请使用 OOTB Web 脚本。
其中返回票证如
TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9
(需要提取)。现在,当使用此票证进行任何类型的操作时,请尝试使用 OOTB alfresco Web 脚本验证票证有效性。请注意,这是基于 HTTP
GET
方法的 Web 脚本这里需要注意的是,您需要进行身份验证此 Web 脚本还附加了
?alf_ticket={ALFRESCO_TICKET}
,否则它将无法工作。最后,当您完成所有操作后,请始终使用 OOTB alfresco 注销 Web 脚本注销。请注意,这是一个基于 HTTP
DELETE
方法的 Web 脚本,您还需要通过附加
?alf_ticket={ALFRESCO_TICKET}
来验证此 Web 脚本,否则它将无法工作。通过这种方式,您可以确保正确的身份验证,并且系统不会因为过时的票证而负担过重。
PS http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference#Logout
The best way to handle alfresco authentication tickets is to handle it manually. E.g. for getting a ticket, use OOTB web script.
which return ticket such as
TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9
(needs to be extracted).Now when using this ticket for any kind of operation, try to verify ticket validity using OOTB alfresco web script.Note that this is a HTTP
GET
method based web scriptThing to note here is that you need to authenticate this web script also by appending
?alf_ticket={ALFRESCO_TICKET}
without which it will not work.Finally when you are done with your things, always log out using OOTB alfresco logout web script. Note that this is a HTTP
DELETE
method based web scriptAgain you need to authenticate this web script also by appending
?alf_ticket={ALFRESCO_TICKET}
without which it will not work.This way you can ensure proper authentication as well as system will not be overburdened with stale tickets.
P.S. http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference#Logout