我正在使用露天默认的网页脚本来获取用户的票证,但我不确定这个获得的票证是否有效.
另外我提取的票据来自获得的露天默认登录web脚本的XML响应.
机票是否有任何到期日或一旦获得机票,它将在会议到期之前到期?
Alfresco存储库中设置的以下属性及其默认值将票证生命周期配置为一小时:
authentication.ticket.validDuration=P1H
Run Code Online (Sandbox Code Playgroud)
您可以通常的方式覆盖此类属性.持续时间类中描述了有意义的值:
* The lexical representation of duration is
* PnYnMnDTnHnMnS.
*
* P is a literal value that starts the expression
* nY is an integer number of years followed by the literal Y
* nM is an integer number of months followed by the literal M
* nD is an integer number of days followed by the literal D
* T is the literal that separates the date and time
* nH is an integer number of hours followed by a literal H
* nM is an integer number of minutes followed by a literal M
* nS is a decimal number of seconds followed by a literal S
Run Code Online (Sandbox Code Playgroud)
请注意,默认情况下,票证的成功使用将更新其有效期,这意味着如果您在一代时间59m之后使用票证对Web脚本调用进行身份验证,则其有效期将延长至又一个小时.
由于票证生命周期是完全可配置的,因此请查看ticketComponent定义的Spring bean authentication-services-context.xml以查看可用选项(例如,设置oneOff为true以仅允许一次使用给定票证).
处理露天认证票据的最佳方法是手动处理.例如,要获得票证,请使用OOTB Web脚本.
http://localhost:8080/alfresco/service/api/login?u=admin&pw=admin
Run Code Online (Sandbox Code Playgroud)
哪个回程票如TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9(需要提取).
现在,当使用此票证进行任何类型的操作时,请尝试使用OOTB alfresco Web脚本验证票证有效性.请注意,这是基于HTTP GET方法的Web脚本
GET /alfresco/service/api/login/ticket/{ticket}
http://localhost:8080/alfresco/service/api/login/ticket/TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9?alf_ticket=TICKET_29ced6613a114294fa4bb9e67b663112076f3d9
Run Code Online (Sandbox Code Playgroud)
这里要注意的是,您需要通过附加来验证此Web脚本?alf_ticket={ALFRESCO_TICKET},否则它将无法正常工作.
最后,当您完成了所有工作后,请务必使用OOTB alfresco logout web脚本注销.请注意,这是一个DELETE基于HTTP 方法的Web脚本
DELETE /alfresco/service/api/login/ticket/{ticket}).
http://localhost:8080/alfresco/service/api/login/ticket/TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9?alf_ticket=TICKET_29ced6613a114294fa4bb9e67bf663112076f3d9
Run Code Online (Sandbox Code Playgroud)
您还需要通过附加来验证此Web脚本?alf_ticket={ALFRESCO_TICKET},否则它将无法正常工作.
这样您就可以确保正确的身份验证,并且系统不会因过时的故障单而负担过重.
PS http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference#Logout
| 归档时间: |
|
| 查看次数: |
8092 次 |
| 最近记录: |