[Building Sakai] Get user session

View: New views
3 Messages — Rating Filter:   Alert me  

[Building Sakai] Get user session

by Wellington Santos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I need get the id of user who is logged in Sakai.
Example: I have my application that will get the user and that user will be logged by Sakai web page login and after he/she will select a link and that link redirect it to my application, so when my application is called I'll get the user id, and after I'll call another application passing more informations by post method. Is there any way to make it? If so, how can I do? Could you send me an example?


Best Regards,


Wellington Santos
Analyst and Integrator of System
People Brasil Educação
Campinas - SP - Brazil
msn: wbsantos@...
skype: wellington.deh
+55 (19) 4062-9750
+55 (11) 3777-4038


_______________________________________________
sakai-dev mailing list
sakai-dev@...
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe@... with a subject of "unsubscribe"

Re: [Building Sakai] Get user session

by Steve Swinsburg-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Wellington,

To get the current userId:
sessionManager.getCurrentSessionUserId();
This will be a Sakai userId, you might need to translate it into an eid for use in other systems. See UserDirectoryService to get an eid from a userid via a User object. Alternatively you can get a Session object from the SessionManager and get the eid from that.

You'll need to inject the SessionManager API into your service via Spring or use the ComponentManager to get it for you.

If you have the full source, issue mvn javadoc:javadoc -Daggregate=true (or just mvn javadoc:aggregate) to get the docs. You might need to repeat for the Kernel source since most core API's live there.

cheers,
Steve



On 05/11/2009, at 11:09 PM, Wellington Santos wrote:

Hi everyone,

I need get the id of user who is logged in Sakai.
Example: I have my application that will get the user and that user will be logged by Sakai web page login and after he/she will select a link and that link redirect it to my application, so when my application is called I'll get the user id, and after I'll call another application passing more informations by post method. Is there any way to make it? If so, how can I do? Could you send me an example?


Best Regards,


Wellington Santos
Analyst and Integrator of System
People Brasil Educação
Campinas - SP - Brazil
msn: wbsantos@...
skype: wellington.deh
+55 (19) 4062-9750
+55 (11) 3777-4038

_______________________________________________
sakai-dev mailing list
sakai-dev@...
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe@... with a subject of "unsubscribe"


_______________________________________________
sakai-dev mailing list
sakai-dev@...
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe@... with a subject of "unsubscribe"

Re: [Building Sakai] Get user session

by Wellington Santos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok Steve, I'll try here, any question I'll back here to ask.
Thanks a lot.


Best Regards,


Wellington Santos
Analyst and Integrator of Systems
People Brasil Educação
Campinas - SP - Brazil
msn: wbsantos@...
skype: wellington.deh
+55 (19) 4062-9750
+55 (11) 3777-4038


Em Qui, 2009-11-05 às 23:24 +1100, Steve Swinsburg escreveu:
Hi Wellington,


To get the current userId:
sessionManager.getCurrentSessionUserId();
This will be a Sakai userId, you might need to translate it into an eid for use in other systems. See UserDirectoryService to get an eid from a userid via a User object. Alternatively you can get a Session object from the SessionManager and get the eid from that.


You'll need to inject the SessionManager API into your service via Spring or use the ComponentManager to get it for you.


If you have the full source, issue mvn javadoc:javadoc -Daggregate=true (or just mvn javadoc:aggregate) to get the docs. You might need to repeat for the Kernel source since most core API's live there.


cheers,
Steve






On 05/11/2009, at 11:09 PM, Wellington Santos wrote:

Hi everyone,

I need get the id of user who is logged in Sakai.
Example: I have my application that will get the user and that user will be logged by Sakai web page login and after he/she will select a link and that link redirect it to my application, so when my application is called I'll get the user id, and after I'll call another application passing more informations by post method. Is there any way to make it? If so, how can I do? Could you send me an example?


Best Regards,


Wellington Santos
Analyst and Integrator of System
People Brasil Educação
Campinas - SP - Brazil
msn: wbsantos@...
skype: wellington.deh
+55 (19) 4062-9750
+55 (11) 3777-4038


_______________________________________________
sakai-dev mailing list
sakai-dev@...
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe@... with a subject of "unsubscribe"



_______________________________________________
sakai-dev mailing list
sakai-dev@...
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe@... with a subject of "unsubscribe"