Your code as posted appears to be built as a stand-alone java app -- the
kind you'd launch from the desktop.  That won't fly in a servlet
environment and we are dealing with the web, not the command line here. 
I highly recommend you get a decent book covering at least tomcat 5.x
and upward as well as read the servlet spec available here for insights
into how to write servlet/jsp code:

http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html

Then you should get familiar with JAAS because that's where magnolia has
provided for external authentication.  A quick Google search should get
you started with the high-level view.

Once those two are under your belt, the magnolia docs and the archives
of this mailing list should make short work of helping you implementing
what you want.

--David

PS. Please have some patience when posting to the list.  We aren't all
glued to our email day and night.  Give an hour or two for someone to
respond.

Hussain, S (Saqib) wrote:

>My main objective is to make the Authentication method to authorize
>users from my custom jsp page.
>
>So if anyone have got authentication method which authorize users in
>magnolia or anyone can help in this regard. I will be really thankful.
>
>Saqib Hussain.
>
>-----Original Message-----
>From: [email protected] [mailto:[EMAIL PROTECTED] 
>Sent: 02 March 2007 12:01
>To: [email protected]
>Subject: Re: [magnolia-user] Help me out ASAP Please !
>
>
>How can I map a repository to make this code work. Or is there anything
>wrong with the code? 
>
>-----Original Message-----
>From: [email protected] [mailto:[EMAIL PROTECTED]
>Sent: 02 March 2007 11:29
>To: [email protected]
>Subject: Re: [magnolia-user] Help me out ASAP Please !
>
>In what context is this code being executed? Read the error message.  
>It basically says there's no "users" workspace/repository.
>
>On Mar 2, 2007, at 12:24 , Hussain, S (Saqib) wrote:
>
>  
>
>>Hi,
>>
>> I am trying to login using my own class in magnolia.
>>
>>
>>I am trying this using following code.
>>
>>
>>import javax.naming.*;
>>import javax.naming.directory.*;
>>import javax.naming.ldap.*;
>>import info.magnolia.context.*;
>>import info.magnolia.cms.security.*;
>>import info.magnolia.jaas.sp.jcr.*;
>>import info.magnolia.jaas.sp.*;
>>import java.util.*;
>>import javax.security.auth.callback.*; import 
>>javax.security.auth.Subject.*; import javax.security.auth.*; import 
>>com.sun.security.auth.callback.TextCallbackHandler;
>>
>>
>>Public class Test {
>>
>>
>>      public static void main(String args[]) {
>>      
>>              try {
>>                      CallbackHandler cbh = new TextCallbackHandler();
>>                      JCRAuthorizationModule jc = new
>>JCRAuthorizationModule ();
>>                      jc.initialize(new Subject(),cbh,new
>>    
>>
>Hashtable(),new Hashtable());
>  
>
>>                      if(jc.login()) {
>>
>>                        Sytem.out.println("Authentication Succeded");
>>                      }
>>
>>              }catch(Exception e){e.printStackTrace();} }
>>
>>
>>It asks me for the username and password in command prompt. But when I
>>    
>>
>
>  
>
>>enter a valid username and password (Even I have tried superuser). It 
>>gives an exception which is:
>>
>>
>>WARN   info.magnolia.cms.beans.config.ContentRepository
>>ContentRepository.java(g
>>etRepositoryMapping:564) 02.03.2007 11:07:22  no mapping for the 
>>repository [use rs] java.lang.NullPointerException
>>        at
>>info.magnolia.jaas.sp.jcr.JCRAuthorizationModule.isValidUser(JCRAutho
>>rizationModule.java:63)
>>        at
>>info.magnolia.jaas.sp.jcr.JCRAuthenticationModule.login(JCRAuthentica
>>tionModule.java:74)
>>        at Test.main(Test.java:53)
>>
>>
>>
>>If anyone can help me out in this authentication method. I am really 
>>stuck at the moment. It would be great if anyone can send me response 
>>ASAP.
>>
>>
>>Thanks in advance.
>>
>>Saqib.
>>
>>    
>>


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to