I'm trying to write the login portion of a webapp using guard. I understand the checker side of things. I'll be using a database as the backend, and checking against it doesn't sound hard. The issue I'm having though, is that my authentication depends on 3 variables. A username, password, and department. I'm not sure what I have to do to get these 3 things into the credential in order to authenticate. Is there a class I have to subclass and then override a method for or what? Thank you.
On Sun, 28 Nov 2004 22:34:19 -0500, orbitz <orbitz@ezabel.com> wrote:
having though, is that my authentication depends on 3 variables. A username, password, and department. I'm not sure what I have to do to get these 3 things into the credential in order to authenticate. Is there a class I have to subclass and then override a method for or what?
You can proceed like this. Authenticate using username and password and return a special avatar (assuming PB). Then call getAvatar(department) remote method on the avatar to get the intended avatar. Even if more than one guy (from different departments) had same username and password, the getAvatar method could easily resolve the conflict. :) HTH -- Sridhar R - http://cs.annauniv.edu/~rsridhar Blog: http://www.livejournal.com/~sridharinfinity
I'm not using PB in this, and that doesn't sound like it solves the issue of actually giving the department to the credential checker so it can give a yes or no. This is fairly nasty but I was thinking of a possible solution being to inherit from SessionWrapper and rewrite teh getCredentials method and then rebind my new class to the one in guard so it uses my class internally which grabs the creds I need (shouldn't guard already work like this except less icky, but providing a means to specify which credentials to use?). I know it sounds gross but sounds like the most straight forward solutiont to what I need..thoughts? Sridhar R wrote:
On Sun, 28 Nov 2004 22:34:19 -0500, orbitz <orbitz@ezabel.com> wrote:
having though, is that my authentication depends on 3 variables. A username, password, and department. I'm not sure what I have to do to get these 3 things into the credential in order to authenticate. Is there a class I have to subclass and then override a method for or what?
You can proceed like this. Authenticate using username and password and return a special avatar (assuming PB). Then call getAvatar(department) remote method on the avatar to get the intended avatar. Even if more than one guy (from different departments) had same username and password, the getAvatar method could easily resolve the conflict. :)
HTH
On Mon, 29 Nov 2004 00:24:25 -0500, orbitz <orbitz@ezabel.com> wrote:
I know it sounds gross but sounds like the most straight forward solutiont to what I need..thoughts?
Never tried it but what about this username: (username, department) (send and receive a tuple) password: password -- Sridhar R - http://cs.annauniv.edu/~rsridhar Blog: http://www.livejournal.com/~sridharinfinity
On second thought, I don't even need to reassign to session wrapper. After looking at things I realized one has to do: appserver.NevowSite(resource=guard.SessionWrapper(limeportal)) I can just subclass it, rewrite the portions i need to, and then use that for the resource. I think that should work fine. Sridhar R wrote:
On Mon, 29 Nov 2004 00:24:25 -0500, orbitz <orbitz@ezabel.com> wrote:
I know it sounds gross but sounds like the most straight forward solutiont to what I need..thoughts?
Never tried it but what about this username: (username, department) (send and receive a tuple) password: password
participants (2)
-
orbitz
-
Sridhar R