Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
play20-auth enlightenment
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason Jackson  
View profile  
 More options Oct 25 2012, 2:39 am
From: Jason Jackson <jasonjack...@gmail.com>
Date: Wed, 24 Oct 2012 23:39:53 -0700 (PDT)
Local: Thurs, Oct 25 2012 2:39 am
Subject: play20-auth enlightenment

I'm looking at the play20-auth module for scala:

https://github.com/t2v/play20-auth

What I am wanting to accomplish is if I user is authenticated as one
authority (NormalUser) they are redirected to one route
(routes.Message.main), but if they are authenticated as another authority
(Administrator) they are redirected to a different route
(routes.Admin.main).

Looking at the AuthConfigImpl trait I am not sure if this should be done in
the loginSucceeded, or how that method should gain access to the users
authority, of if that should be added to the authorize method, where the
case statements should be something other than true.  There are a lot of
"tailor this to fit your application" comments in the code, but I'm not
clear on how this should be tailored, and haven't found any examples which
use this module that I can dissect.

Can anyone point me in a direction of how to accomplish this, or a sample
application which uses this module?

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Sargent  
View profile   Translate to Translated (View Original)
 More options Oct 25 2012, 3:10 pm
From: Will Sargent <will.sarg...@gmail.com>
Date: Thu, 25 Oct 2012 12:09:33 -0700
Local: Thurs, Oct 25 2012 3:09 pm
Subject: Re: [play-framework] play20-auth enlightenment

I don't know exactly how you do this in play20-auth, but I know the
general theory -- Authlogic and Devise (Rails gems) do this by
specifying multiple sessions, one for each login.

You don't need to go that far, but in the PLAY_SESSION cookie, you
have a map of user ids with the key being things like "userId" and
"adminId". You can have the option to be logged in as both, but in
this case it sounds like you want the loginSucceeded to check for the
value and log you out of the other one.

I've written a sample project based on play20-auth that might make
things a little clearer:

https://github.com/wsargent/play20-rememberme

Will.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Sargent  
View profile   Translate to Translated (View Original)
 More options Oct 25 2012, 3:22 pm
From: Will Sargent <will.sarg...@gmail.com>
Date: Thu, 25 Oct 2012 12:21:40 -0700
Local: Thurs, Oct 25 2012 3:21 pm
Subject: Re: [play-framework] play20-auth enlightenment
Okay, more detail -- using AuthController [1] as a guide, you want
another AuthController called "AdminAuthController" -- you want to
change the SessionCookie, either to be (newly created)
AdminSessonCookie or by encoding a map in the regular session cookie,
and you want a new AdminAuthenticationService for logging in as an
admin.

I should probably abstract the session logic into a BaseSession the
same way that Authlogic has Authlogic::Session::Base, but given you're
the first person who's asked...

Will.

[1] https://github.com/wsargent/play20-rememberme/blob/master/app/control...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »