如果存在,则测试用户帐户alfresco CMIS

编程入门 行业动态 更新时间:2024-10-07 14:27:15
本文介绍了如果存在,则测试用户帐户alfresco CMIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 JavaEE 项目中工作,我只想查看用户是否以用户名登录和密码在 Alfresco 中拥有一个帐户,我使用 getSession 方法但如果用户名和密码错误(不存在),则不会返回。

I am working in a JavaEE project and i want simply see if the user ho logged in with a username and a password have an account in Alfresco, I user the getSession method but it doesn't return if the username and password are wrong (doesn't exist).

private static Session getSession(String serverUrl, String username, String password) { SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); Map<String, String> params = new HashMap<>(); params.put(SessionParameter.USER, username); params.put(SessionParameter.PASSWORD, password); params.put(SessionParameter.ATOMPUB_URL, serverUrl); params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); List<Repository> repos = sessionFactory.getRepositories(params); if (repos.isEmpty()) { System.out.println(" repository doesn't exist "); throw new RuntimeException("Server has no repositories!"); } return repos.get(0).createSession(); }

谢谢

推荐答案

经过多次研究后,我发现 Rest Api Alfresco

After many research i discover the Rest Api for Alfresco

GET /alfresco/service/api/people/{userName}

对于我的情况我使用它并为我工作

for my case I used it and worked for me

你可以在这个链接中找到更多 wiki.alfresco/wiki/Repository_RESTful_API_Reference (如何添加人,如何检查是否有人私人网站的成员......)。

you can find more in this link wiki.alfresco/wiki/Repository_RESTful_API_Reference (how to add a person, how to check if someone is a member of a private site ... ).

更多推荐

如果存在,则测试用户帐户alfresco CMIS

本文发布于:2023-11-28 11:20:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642193.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帐户   测试   用户   CMIS   alfresco

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!