1 Reply Latest reply on May 16, 2013 10:44 AM by Karsten Torp

    Seam Authentication with RESTEasy

    omid pourhadi Apprentice



      I need to create a REST service to enable users to login into my seam application. does anyone have experience regarding this issue ?


      I've created a service as follow but it still wants username and password when I request a secure page


      public class LoginResource {
         Identity identity;
         Credentials credentials;
         IdentityManager identityManager;
         public void doLogin(@QueryParam("uname") String uname, @QueryParam String pass){
              //the rest is the same as my Authenticator Bean 
        • 1. Re: Seam Authentication with RESTEasy
          Karsten Torp Newbie

          This is how we do it:

          Identity identity = Identity.instance();
          Credentials credentials = identity.getCredentials();
          String result = identity.login();
          if (!identity.isLoggedIn()) {     
               throw new InvalidAccessException();

          Also, we have @BypassInterceptorsin on almost every class and don't use @In.

          I hole this helps.