How to log in thru webservices

47 views Asked by At

From an external application, I am calling a rest web service that is implemented in Jspresso.

In the Jspresso web service, I would like to initialize the environment/context in order to act like a user connected by the login module.

Is there a method to call to initialize the environment (userPrincipal, ...)

1

There are 1 answers

0
Vincent Vandenschrick On

Normally, your web services classes should extend org.jspresso.framework.application.startup.AbstractBackendStartup. Then you can use the following protected methods :

  • protected Subject createSubject(String userName)
  • protected void configureApplicationSession(Subject subject, Locale locale)

This will initialize a session with all necessary information.