2 Replies Latest reply on Feb 9, 2011 11:55 AM by Alessandro Novarini

    How to set a login configuration?

    Alessandro Novarini Newbie

      Hello,

       

      Sorry for the dumb question, but I'm fairly new to this topic.

       

      After some time "patching" ModeShape to run it into an OSGI container (Sling/Felix), I am now stuck at the following exception:

       

      08.02.2011 17:14:47.677 *INFO* [Repository Pinger] com.sourcesense.stone.jcr.modeshape.server pingAndCheck; loginAdministrative failed (javax.jcr.RepositoryException: Unable to locate a login configuration) javax.jcr.RepositoryException: Unable to locate a login configuration

                at org.apache.sling.jcr.base.AbstractSlingRepository.login(AbstractSlingRepository.java:250)

                at org.apache.sling.jcr.base.AbstractSlingRepository.loginAdministrative(AbstractSlingRepository.java:180)

                at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:517)

                at org.apache.sling.jcr.base.AbstractSlingRepository.startRepository(AbstractSlingRepository.java:804)

                at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:925)

                at java.lang.Thread.run(Thread.java:680)

      Caused by: java.lang.SecurityException: Unable to locate a login configuration

                at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                at java.lang.Class.newInstance0(Class.java:355)

                at java.lang.Class.newInstance(Class.java:308)

                at javax.security.auth.login.Configuration$3.run(Configuration.java:247)

                at java.security.AccessController.doPrivileged(Native Method)

                at javax.security.auth.login.Configuration.getConfiguration(Configuration.java:242)

                at javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)

                at java.security.AccessController.doPrivileged(Native Method)

                at javax.security.auth.login.LoginContext.init(LoginContext.java:234)

                at javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)

                at org.modeshape.graph.JaasSecurityContext.<init>(JaasSecurityContext.java:82)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1324)

                at org.apache.sling.jcr.base.AbstractSlingRepository.login(AbstractSlingRepository.java:214)

                ... 5 more

      Caused by: java.io.IOException: Unable to locate a login configuration

                at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:250)

                at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:91)

                ... 21 more

       

      Please can anyone explain me why this is happening and how to solve it? I guess the code is trying to load a configuration file, but I don't know where it is supposed to be or how you can tell where to look for.

       

      Thank you in advance,

      Ale

        • 1. How to set a login configuration?
          Randall Hauch Master

          ModeShape uses JAAS for its authentication & authorization system, and it's looking for a JAAS installation but is unable to find one. See our Reference Guide for some information and links to the JBoss JAAS implementation.

           

          There are a few other options for customization, however. What does Sling use for authentication & authorization? Does it rely upon the JCR implementation, or does it have its own?

          1 of 1 people found this helpful
          • 2. How to set a login configuration?
            Alessandro Novarini Newbie

            Thanks Randall for the quick reply.

             

            I did read the documentation, and I did as instructed writing a custom security context. That looked good until the Sling web console passed again a SimpleCredentials to the login method.

             

            Basically, now the web console is broken, since no valid credentials can be passed to the login module and every function is under authentication.

             

            I think that the only thing I can do now is a full reinstallation of the repository

             

            I've also sent an email to the sling ml, I'll keep you informed about how the thing goes.

             

            Thanks again

            Ale