Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
How can I get a user's id etc. by its email address in CQ 5.6.1 or up?
Solucionado! Ir para a Solução.
We have a community article that talks about working with the user manager. This article retrieves users and displays them in a grid control:
[img]UserGrid.png[/img]
This will help you - notice that email is listed as a column.
See:
http://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html
For this workflow - you can get all users then iterate through the result set and compare email. Once you have the user you want -- get the other properties.
Some people like using User Manager while others like the lower level JCR API.
Visualizações
respostas
Total de curtidas
You can use JCR API to search for a node (the node that contains the user information) searching on the email address (which will be a property). Once you have the node -- you can read other properties.
Visualizações
respostas
Total de curtidas
I was hoping like UserManager could have api to do that kind of job.
Visualizações
respostas
Total de curtidas
We have a community article that talks about working with the user manager. This article retrieves users and displays them in a grid control:
[img]UserGrid.png[/img]
This will help you - notice that email is listed as a column.
See:
http://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html
For this workflow - you can get all users then iterate through the result set and compare email. Once you have the user you want -- get the other properties.
Some people like using User Manager while others like the lower level JCR API.
Visualizações
respostas
Total de curtidas
The UserManager does have an API for this, which you should use instead of directly using JCR query - https://dev.day.com/docs/en/cq/current/javadoc/org/apache/jackrabbit/api/security/user/UserManager.h..., java.lang.String, int). The reason this is preferrable is that the the node types used for representing users are technically an implementation detail of the UserManager implementation.
Visualizações
respostas
Total de curtidas
Thanks for your reply!
I created a user with email as "myemail@geometrixx.info". Then tried to call this api as this:
userMgr.findAuthorizables("email", "myemail@geometrixx.info", UserManager.SEARCH_TYPE_USER)
It doesn't return the matched user.
Can you see anything that I did wrong?
Visualizações
respostas
Total de curtidas
Yes, that's helpful. Thanks a lot!
The email property is on the profile child node, so you need to do
userMgr.findAuthorizables("email", "myemail@geometrixx.info", UserManager.SEARCH_TYPE_USER)
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas