users@glassfish.java.net

Re: Want to debug JDBCRealm

From: Stijn de Witt <StijnDeWitt_at_chello.nl>
Date: Mon, 3 May 2010 21:18:13 +0200

Thanks for helping out Martin.

I am looking at login.conf right now and indeed it does not mention anywhere the JDBCRealm class. It only configures a JDBCLoginModule... But looking at the source for that I see:
(lots of code snipped for brevity)

package com.sun.enterprise.security.auth.login;
//...
import com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm;

//...
public class JDBCLoginModule extends PasswordLoginModule {

    //...
    protected void authenticate() throws LoginException {
        if (!(_currentRealm instanceof JDBCRealm)) {
            String msg = sm.getString("jdbclm.badrealm");
            throw new LoginException(msg);
        }
        
... so it seems to me that this approach of creating a custom JDBCRealm in my own package will not work unless I also make my own LoginModule, as the default one is checking that the current realm is an instance of sun's JDBCRealm.

But if I now also make my own LoginModule I feel my setup has got nothing to do anymore with the setup I am having trouble with and want to debug... Mmm.. this basically brings me back to my original question:

Does anyone know how to debug the JDBCRealm in Glassfish v3? I would preferable attach the Eclipse debugger to the running Glassfish server, set the source location and then step through the Realm and LoginModule code.

Any help would be greatly appreciated, as I have been banging my head agains this for over a week now and the JDBCRealm looked as if it was simple to setup. The problem is that it gives hardly any info on why logins are failing, except the fact that they are failing.

-Stijn

  ----- Original Message -----
  From: Martin Gainty
  To: Users GlassFish.dev.java.net
  Sent: Monday, May 03, 2010 8:50 PM
  Subject: RE: Want to debug JDBCRealm


  you are authenticating at the DB level so the short answer is no you will NOT need to configure another login

  Martin
  ______________________________________________
  Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité


  Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: StijnDeWitt_at_chello.nl
> To: users_at_glassfish.dev.java.net
> Date: Mon, 3 May 2010 20:30:09 +0200
> Subject: Re: Want to debug JDBCRealm
>
> I hope I am not becoming annoying.. but...
>
> If I create my own JDBCRealm by copying the original source code I would
> have
> to add a custom login configuration to <domainroot>/config/login.config
> right?
> And setup a new Realm configuration in Glassfish?
>
> I was hoping I could somehow attach the Eclipse debugger to a running
> instance
> of Glassfish and tell Eclipse where to find the source for the Glassfish
> instance
> so I could debug the actual realm I'll be using in production. Do you know
> if this
> is possible?
>
> Thanks again for all your help, it's greatly appreciated!
>
> -Stijn
>
>
> ----- Original Message -----
> From: "Dominik Dorn" <dominik.dorn_at_gmail.com>
> To: <users_at_glassfish.dev.java.net>
> Sent: Monday, May 03, 2010 8:18 PM
> Subject: Re: Want to debug JDBCRealm
>
>
> > you could simply copy the jdbc realm to your own namespace/package and
> > use that one.
> > You don't have to compile the whole application server, the jdbc realm is
> > just about 100 lines or so.
> >
> >
> > On Mon, May 3, 2010 at 7:21 PM, Stijn de Witt <StijnDeWitt_at_chello.nl>
> > wrote:
> >> Thanks Dominik,
> >>
> >> <snip> I still have a question. You say I should copy the compiled
> >> classes to
> >> Glassfish's lib directory... but I thought the JDBCRealm is bundled with
> >> Glassfish
> >> already? Won't me copying a second JDBCRealm in there cause conflicts?
> >>
> >> I will let you know of my progress. Thanks for your help!
> >>
> >> -Stijn
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>


------------------------------------------------------------------------------
  The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.