cancel
Showing results for 
Search instead for 
Did you mean: 

how to share alfreasco session

mmrs
Champ in-the-making
Champ in-the-making
hi
i have a jsf application and i'd like to use alfresco authentication services
i had these tow application in my wepapps dir "alfresco" and "CRC", and i want to go back and forth from my app to alfresco session,
so is there away to do that without the need to edit alfresco code??
or do i have to customize it and write my own code in alfresco to be able to do that
as a first aid the scenario shall looks like this:
A : user click login button.
B : go to class implementing action listener
C : passing user and pass to servlet
D : servlet obtain the alfresco context and authenticate recieved user info using the alfresco authentication service
E : Now how can i get the session that login info is written to without editing code in alfresco app ? or do i have to ?
   
thnx in advance


best regards
mmrs
4 REPLIES 4

lotharm
Champ on-the-rise
Champ on-the-rise
I also would love to find an elegant solution to this problem "Integrate an application with Alfresco using Alfrescos authentication". Alfresco authentication has so much rich features (SSO, Chaining, LDAP, …). I solved it once using the inelegant approach of "merging" the other small app into the alfresco.war. This worked, but has other major drawbacks.

I thought of another solution using Alfrescos ticket service:
* enable the other app to verify an Alfresco ticket by SOAP or a special WebScript implemented in a filter.
* some redirects to get the ticket

If you just need to build a valid link to Alfresco from your other app, the ticket feature could also be a solution.

mmrs
Champ in-the-making
Champ in-the-making
thnx for ur reply

about merging the other app in the alfresco.war : i dont think this is a good idea as u describe it "inelegent" .
but the approach "passing authentication ticket " seems pretty reasonable and thats what i'm trying to do.but how to do that !

temporary i'm forced to call authentication service on each request!
but right now i'm facing another issue:
which is how to retrieve all the users and view them in details in an html table.

i read something about doing that in webscript 
but i've never use web script  :?
so is it possible to retrieve all users using java code ?? and how ??

till now i manage to get users count and thier NodeRef id


Object allUsers[]=(Object[]) getPersonService().getAllPeople().toArray();
        System.out.println("Number of users : "+ allUsers.length);
        for (int i = 0; i < allUsers.length; i++) {
            NodeRef nodeRef = (NodeRef) allUsers[i];
            System.out.println("User("+i+") id ="+nodeRef.getId());

        }
since the NodeRef represent a user, then i should be able to get it's corresponding username, pasword, …etc. right?
but i dont know how ! :cry:
i try to search the alfresco online documentation but with zero results.
as u noticed i m newbie to alfresco.
any help is appreciated  Smiley Tongue

best regards
mmrs

mmrs
Champ in-the-making
Champ in-the-making
well.. i solved that problem . 😎
the solution was :

try{
           Object allNodes[]=(Object[]) getPersonService().getAllPeople().toArray();
          
           NodeRef userRef;
          
           Map<QName,Serializable> user;
          
           Vector<Map> users=new Vector();
           for (int i = 0; i < allNodes.length; i++) {
               userRef = (NodeRef) allNodes[i];
               user=getServiceRegistry().getNodeService().getProperties(userRef);
               users.add(i,user);      
               userRef=null;
                            user=null;
           }
           return users;
       }catch(Exception ex){
          System.out.println("Error :");
          ex.printStackTrace();
          return null;
       }

best regards
mmrs

ericnk
Champ on-the-rise
Champ on-the-rise
LotharM,

I'm also attempting to leverage an existing external web application using Alfresco authentication within Alfresco Share, which requires that I obtain an existing authenticated Share ticket.  Once I have the ticket, I can use it for any subsequent Alfresco repository interaction, effectively creating a SSO solution for both applications.  Unfortunately, I cannot find a way to acquire this ticket through any of the Share (Spring SURF) API's as documented on the various alfresco wikis.  From what I understand, the share session used to be exposed and available from which you could extract the authenticated alfresco ticket, but it is no longer available…..

http://stackoverflow.com/questions/4491698/how-to-get-alf-ticket-in-alfresco-share-3-4

The alfresco template guide indicates that it is available…

http://wiki.alfresco.com/wiki/Template_Guide

…., but that guide references version 2.1 and may possibly be out of date.  It may be that I'm missing something.  You mentioned previously…..

I thought of another solution using Alfrescos ticket service:
* enable the other app to verify an Alfresco ticket by SOAP or a special WebScript implemented in a filter.
* some redirects to get the ticket

If you just need to build a valid link to Alfresco from your other app, the ticket feature could also be a solution.

Have you successfully implemented this ticket solution?  If so, will you provide details of how you did it?  I would very much appreciate it.  I look forward to any comments or suggestions.  Thank you.


Regards,

Eric