You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2014/08/19 22:04:11 UTC

Tynamo ApplicationStateManager Example

Hi guys, I see this example of ApplicationStateManager being used with the
federatedaccounts example. line 20

https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java

I've never seen it used before, so I was hoping someone could provide some
insight on what this code is actually doing and what the purpose of using
 ApplicationStateManager is.

Thanks,


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
Hi Kalle, just wondering if you had a chance to take a look at making
federate work with 5.4. If there is something you feel I might be able to
assist with, please let me know. Thanks.

On Thu, Aug 21, 2014 at 11:14 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> Probably in the library if it happens right after clicking on the link.
>
> Kalle
>
>
> On Thu, Aug 21, 2014 at 6:13 AM, George Christman <gchristman@cardaddy.com
> >
> wrote:
>
> > For the time being I was able to somewhat get things working by adding
> the
> > js to my local META-INF directory. When I clicked the facebook link I
> > received a 400 error. Do you think this is a configuration error on my
> end,
> > or do you think it maybe a side effect of it not working in 5.4? I guess
> it
> > could also be a configuration issue within my facebook account too, I'm
> not
> > really sure yet. What are your thoughts?
> >
> >
> > On Thu, Aug 21, 2014 at 12:25 AM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com
> > > wrote:
> >
> > > Unfortunately, I haven't updated federatedaccounts module to work with
> > T5.4
> > > yet. It's pretty simple as tapestry-security already supports T5.4 but
> > will
> > > be a week or two before I get to it because work's keeping me busy.
> > Patches
> > > welcome of course.
> > >
> > > Kalle
> > >
> > >
> > > On Wed, Aug 20, 2014 at 4:53 PM, George Christman <
> > gchristman@cardaddy.com
> > > >
> > > wrote:
> > >
> > > > Hi Kalle, I'm getting the following exception,
> > > >
> > > >
> > > >
> > > > *Unable to locate asset 'OauthSignIn.js' for component
> > > > registration/Signin:facebookoauthsignin. It should be located at
> > > > META-INF/assets/federated/OauthSignIn.js.*
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > *I'm using 5.4 and the following dependencies. Any thought why the
> > > > OauthSignin.js might be missing? Thanks. <dependency>
> > > > <groupId>org.tynamo</groupId>
> > > > <artifactId>tapestry-security</artifactId>
> > > > <version>0.5.1</version>        </dependency><dependency>
> > > > <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-facebook</artifactId>
> > > > <version>0.4.3</version>        </dependency>
> > > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-twitter</artifactId>
> > > > <version>0.4.3</version>        </dependency>
> > > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
> > > > <version>0.4.3</version>        </dependency>*
> > > >
> > > >
> > > > On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <
> > > > kalle.o.korhonen@gmail.com
> > > > > wrote:
> > > >
> > > > > It's all sample code for typical use cases. For authentication, you
> > > need
> > > > to
> > > > > have (or Shiro needs to have) an AuthenticationInfo in session.
> > That's
> > > > > where the principals and the credentials tokens are stored.
> > Separately,
> > > > in
> > > > > your Tapestry application, you may have several (preferably light)
> > > > session
> > > > > objects for a user who may or may not have been authenticated, such
> > as
> > > a
> > > > > shopping cart or a simple user object caching the most important
> user
> > > > > attributes as a performance optimization (in a database backed
> > > > > environment). In the case of this sample, you want to create or
> > update
> > > > this
> > > > > user object from data obtained by the remote authentication
> provider.
> > > > >
> > > > > Kalle
> > > > >
> > > > >
> > > > > On Tue, Aug 19, 2014 at 7:38 PM, George Christman <
> > > > gchristman@cardaddy.com
> > > > > >
> > > > > wrote:
> > > > >
> > > > > > I think where I was confused was coming at this with the idea of
> > > > having a
> > > > > > database backed environment. I see your comments in
> > CurrentUser.class
> > > > > > about ApplicationStateCreator
> > > > > > although I still don't fully understand it. I also seen some code
> > > where
> > > > > you
> > > > > > were commenting out
> > > > > > SimpleAuthenticationInfo where it takes currentUser. With that
> > being
> > > > > > commented out, I'm just not sure I understand how currentUser and
> > the
> > > > > merge
> > > > > > are getting used.
> > > > > >
> > > > > >
> > > > > > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > > > > > kalle.o.korhonen@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > The examples lack comments because I strongly believe in
> > > > > self-documenting
> > > > > > > code. FederatedAccountService.federate() is the core concept of
> > the
> > > > > > > federated account module. Federated accounts module allows you
> to
> > > > > > federate
> > > > > > > (i.e. join, merge) separate accounts together. The
> implementation
> > > of
> > > > > this
> > > > > > > CurrentUser is with the example code and a sample
> implementation
> > > for
> > > > > > restfb
> > > > > > > remote account is:
> > > > > > >     public void merge(com.restfb.types.User user) {
> > > > > > >         username = user.getName();
> > > > > > >         firstName = user.getFirstName();
> > > > > > >         lastName = user.getLastName();
> > > > > > >     }
> > > > > > >
> > > > > > > Any code example requires you to read the code but I'm not sure
> > > how I
> > > > > > could
> > > > > > > change the code to highlight the possibilities better.
> Obviously,
> > > > > what's
> > > > > > > clear to me may not be so for others, so any suggestions for
> > > > > improvements
> > > > > > > are welcome.
> > > > > > >
> > > > > > > Kalle
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <
> > chris@opencsta.org
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > CurrentUser.class
> > > > > > > >
> > > > > > > > Its a get method, probably on a hashtable-like object.
> Getting
> > > > > current
> > > > > > > > user.
> > > > > > > >
> > > > > > > > The auth token is probably from the oauth2 provider like fb
> or
> > > gg.
> > > > > > > >
> > > > > > > > With the current user and this token, merge them in *your*
> app.
> > > > > > > >
> > > > > > > > /guessing
> > > > > > > > On 20/08/2014 7:05 am, "George Christman" <
> > > gchristman@cardaddy.com
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > I guess I'm not following the logic of the code then. Why
> > would
> > > > > they
> > > > > > be
> > > > > > > > > passing CurrentUser into it then?
> > > > > > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <
> > > lance.java@googlemail.com
> > > > >
> > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > The ApplicationStateManager is a core Tapestry service
> and
> > is
> > > > an
> > > > > > > > > > abstraction over HttpSession persistence. As stated in
> the
> > > > > javadocs
> > > > > > > > > > Application state is probably a bad choice of naming. In
> > > > > hindsight
> > > > > > it
> > > > > > > > > > should probably be called SessionStateManager.
> > > > > > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> > > > > gchristman@cardaddy.com
> > > > > > >
> > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi guys, I see this example of ApplicationStateManager
> > > being
> > > > > used
> > > > > > > > with
> > > > > > > > > > the
> > > > > > > > > > > federatedaccounts example. line 20
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > > > > > >
> > > > > > > > > > > I've never seen it used before, so I was hoping someone
> > > could
> > > > > > > provide
> > > > > > > > > > some
> > > > > > > > > > > insight on what this code is actually doing and what
> the
> > > > > purpose
> > > > > > of
> > > > > > > > > using
> > > > > > > > > > >  ApplicationStateManager is.
> > > > > > > > > > >
> > > > > > > > > > > Thanks,
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > George Christman
> > > > > > > > > > > www.CarDaddy.com
> > > > > > > > > > > P.O. Box 735
> > > > > > > > > > > Johnstown, New York
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > George Christman
> > > > > > www.CarDaddy.com
> > > > > > P.O. Box 735
> > > > > > Johnstown, New York
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > George Christman
> > > > www.CarDaddy.com
> > > > P.O. Box 735
> > > > Johnstown, New York
> > > >
> > >
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
Okay I'll take a look over the weekend and see if I can figure it out.
Can't really promise I will though lol. Just an fyi, an up and coming
single sign on that might be worth including is amazon. It really helps if
you have an ecommerce site where you want to use amazon payment processing.


On Thu, Aug 21, 2014 at 11:14 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> Probably in the library if it happens right after clicking on the link.
>
> Kalle
>
>
> On Thu, Aug 21, 2014 at 6:13 AM, George Christman <gchristman@cardaddy.com
> >
> wrote:
>
> > For the time being I was able to somewhat get things working by adding
> the
> > js to my local META-INF directory. When I clicked the facebook link I
> > received a 400 error. Do you think this is a configuration error on my
> end,
> > or do you think it maybe a side effect of it not working in 5.4? I guess
> it
> > could also be a configuration issue within my facebook account too, I'm
> not
> > really sure yet. What are your thoughts?
> >
> >
> > On Thu, Aug 21, 2014 at 12:25 AM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com
> > > wrote:
> >
> > > Unfortunately, I haven't updated federatedaccounts module to work with
> > T5.4
> > > yet. It's pretty simple as tapestry-security already supports T5.4 but
> > will
> > > be a week or two before I get to it because work's keeping me busy.
> > Patches
> > > welcome of course.
> > >
> > > Kalle
> > >
> > >
> > > On Wed, Aug 20, 2014 at 4:53 PM, George Christman <
> > gchristman@cardaddy.com
> > > >
> > > wrote:
> > >
> > > > Hi Kalle, I'm getting the following exception,
> > > >
> > > >
> > > >
> > > > *Unable to locate asset 'OauthSignIn.js' for component
> > > > registration/Signin:facebookoauthsignin. It should be located at
> > > > META-INF/assets/federated/OauthSignIn.js.*
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > *I'm using 5.4 and the following dependencies. Any thought why the
> > > > OauthSignin.js might be missing? Thanks. <dependency>
> > > > <groupId>org.tynamo</groupId>
> > > > <artifactId>tapestry-security</artifactId>
> > > > <version>0.5.1</version>        </dependency><dependency>
> > > > <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-facebook</artifactId>
> > > > <version>0.4.3</version>        </dependency>
> > > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-twitter</artifactId>
> > > > <version>0.4.3</version>        </dependency>
> > > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > > <artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
> > > > <version>0.4.3</version>        </dependency>*
> > > >
> > > >
> > > > On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <
> > > > kalle.o.korhonen@gmail.com
> > > > > wrote:
> > > >
> > > > > It's all sample code for typical use cases. For authentication, you
> > > need
> > > > to
> > > > > have (or Shiro needs to have) an AuthenticationInfo in session.
> > That's
> > > > > where the principals and the credentials tokens are stored.
> > Separately,
> > > > in
> > > > > your Tapestry application, you may have several (preferably light)
> > > > session
> > > > > objects for a user who may or may not have been authenticated, such
> > as
> > > a
> > > > > shopping cart or a simple user object caching the most important
> user
> > > > > attributes as a performance optimization (in a database backed
> > > > > environment). In the case of this sample, you want to create or
> > update
> > > > this
> > > > > user object from data obtained by the remote authentication
> provider.
> > > > >
> > > > > Kalle
> > > > >
> > > > >
> > > > > On Tue, Aug 19, 2014 at 7:38 PM, George Christman <
> > > > gchristman@cardaddy.com
> > > > > >
> > > > > wrote:
> > > > >
> > > > > > I think where I was confused was coming at this with the idea of
> > > > having a
> > > > > > database backed environment. I see your comments in
> > CurrentUser.class
> > > > > > about ApplicationStateCreator
> > > > > > although I still don't fully understand it. I also seen some code
> > > where
> > > > > you
> > > > > > were commenting out
> > > > > > SimpleAuthenticationInfo where it takes currentUser. With that
> > being
> > > > > > commented out, I'm just not sure I understand how currentUser and
> > the
> > > > > merge
> > > > > > are getting used.
> > > > > >
> > > > > >
> > > > > > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > > > > > kalle.o.korhonen@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > The examples lack comments because I strongly believe in
> > > > > self-documenting
> > > > > > > code. FederatedAccountService.federate() is the core concept of
> > the
> > > > > > > federated account module. Federated accounts module allows you
> to
> > > > > > federate
> > > > > > > (i.e. join, merge) separate accounts together. The
> implementation
> > > of
> > > > > this
> > > > > > > CurrentUser is with the example code and a sample
> implementation
> > > for
> > > > > > restfb
> > > > > > > remote account is:
> > > > > > >     public void merge(com.restfb.types.User user) {
> > > > > > >         username = user.getName();
> > > > > > >         firstName = user.getFirstName();
> > > > > > >         lastName = user.getLastName();
> > > > > > >     }
> > > > > > >
> > > > > > > Any code example requires you to read the code but I'm not sure
> > > how I
> > > > > > could
> > > > > > > change the code to highlight the possibilities better.
> Obviously,
> > > > > what's
> > > > > > > clear to me may not be so for others, so any suggestions for
> > > > > improvements
> > > > > > > are welcome.
> > > > > > >
> > > > > > > Kalle
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <
> > chris@opencsta.org
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > CurrentUser.class
> > > > > > > >
> > > > > > > > Its a get method, probably on a hashtable-like object.
> Getting
> > > > > current
> > > > > > > > user.
> > > > > > > >
> > > > > > > > The auth token is probably from the oauth2 provider like fb
> or
> > > gg.
> > > > > > > >
> > > > > > > > With the current user and this token, merge them in *your*
> app.
> > > > > > > >
> > > > > > > > /guessing
> > > > > > > > On 20/08/2014 7:05 am, "George Christman" <
> > > gchristman@cardaddy.com
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > I guess I'm not following the logic of the code then. Why
> > would
> > > > > they
> > > > > > be
> > > > > > > > > passing CurrentUser into it then?
> > > > > > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <
> > > lance.java@googlemail.com
> > > > >
> > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > The ApplicationStateManager is a core Tapestry service
> and
> > is
> > > > an
> > > > > > > > > > abstraction over HttpSession persistence. As stated in
> the
> > > > > javadocs
> > > > > > > > > > Application state is probably a bad choice of naming. In
> > > > > hindsight
> > > > > > it
> > > > > > > > > > should probably be called SessionStateManager.
> > > > > > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> > > > > gchristman@cardaddy.com
> > > > > > >
> > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi guys, I see this example of ApplicationStateManager
> > > being
> > > > > used
> > > > > > > > with
> > > > > > > > > > the
> > > > > > > > > > > federatedaccounts example. line 20
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > > > > > >
> > > > > > > > > > > I've never seen it used before, so I was hoping someone
> > > could
> > > > > > > provide
> > > > > > > > > > some
> > > > > > > > > > > insight on what this code is actually doing and what
> the
> > > > > purpose
> > > > > > of
> > > > > > > > > using
> > > > > > > > > > >  ApplicationStateManager is.
> > > > > > > > > > >
> > > > > > > > > > > Thanks,
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > George Christman
> > > > > > > > > > > www.CarDaddy.com
> > > > > > > > > > > P.O. Box 735
> > > > > > > > > > > Johnstown, New York
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > George Christman
> > > > > > www.CarDaddy.com
> > > > > > P.O. Box 735
> > > > > > Johnstown, New York
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > George Christman
> > > > www.CarDaddy.com
> > > > P.O. Box 735
> > > > Johnstown, New York
> > > >
> > >
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by Kalle Korhonen <ka...@gmail.com>.
Probably in the library if it happens right after clicking on the link.

Kalle


On Thu, Aug 21, 2014 at 6:13 AM, George Christman <gc...@cardaddy.com>
wrote:

> For the time being I was able to somewhat get things working by adding the
> js to my local META-INF directory. When I clicked the facebook link I
> received a 400 error. Do you think this is a configuration error on my end,
> or do you think it maybe a side effect of it not working in 5.4? I guess it
> could also be a configuration issue within my facebook account too, I'm not
> really sure yet. What are your thoughts?
>
>
> On Thu, Aug 21, 2014 at 12:25 AM, Kalle Korhonen <
> kalle.o.korhonen@gmail.com
> > wrote:
>
> > Unfortunately, I haven't updated federatedaccounts module to work with
> T5.4
> > yet. It's pretty simple as tapestry-security already supports T5.4 but
> will
> > be a week or two before I get to it because work's keeping me busy.
> Patches
> > welcome of course.
> >
> > Kalle
> >
> >
> > On Wed, Aug 20, 2014 at 4:53 PM, George Christman <
> gchristman@cardaddy.com
> > >
> > wrote:
> >
> > > Hi Kalle, I'm getting the following exception,
> > >
> > >
> > >
> > > *Unable to locate asset 'OauthSignIn.js' for component
> > > registration/Signin:facebookoauthsignin. It should be located at
> > > META-INF/assets/federated/OauthSignIn.js.*
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > *I'm using 5.4 and the following dependencies. Any thought why the
> > > OauthSignin.js might be missing? Thanks. <dependency>
> > > <groupId>org.tynamo</groupId>
> > > <artifactId>tapestry-security</artifactId>
> > > <version>0.5.1</version>        </dependency><dependency>
> > > <groupId>org.tynamo.security</groupId>
> > > <artifactId>tynamo-federatedaccounts-facebook</artifactId>
> > > <version>0.4.3</version>        </dependency>
> > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > <artifactId>tynamo-federatedaccounts-twitter</artifactId>
> > > <version>0.4.3</version>        </dependency>
> > > <dependency>            <groupId>org.tynamo.security</groupId>
> > > <artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
> > > <version>0.4.3</version>        </dependency>*
> > >
> > >
> > > On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <
> > > kalle.o.korhonen@gmail.com
> > > > wrote:
> > >
> > > > It's all sample code for typical use cases. For authentication, you
> > need
> > > to
> > > > have (or Shiro needs to have) an AuthenticationInfo in session.
> That's
> > > > where the principals and the credentials tokens are stored.
> Separately,
> > > in
> > > > your Tapestry application, you may have several (preferably light)
> > > session
> > > > objects for a user who may or may not have been authenticated, such
> as
> > a
> > > > shopping cart or a simple user object caching the most important user
> > > > attributes as a performance optimization (in a database backed
> > > > environment). In the case of this sample, you want to create or
> update
> > > this
> > > > user object from data obtained by the remote authentication provider.
> > > >
> > > > Kalle
> > > >
> > > >
> > > > On Tue, Aug 19, 2014 at 7:38 PM, George Christman <
> > > gchristman@cardaddy.com
> > > > >
> > > > wrote:
> > > >
> > > > > I think where I was confused was coming at this with the idea of
> > > having a
> > > > > database backed environment. I see your comments in
> CurrentUser.class
> > > > > about ApplicationStateCreator
> > > > > although I still don't fully understand it. I also seen some code
> > where
> > > > you
> > > > > were commenting out
> > > > > SimpleAuthenticationInfo where it takes currentUser. With that
> being
> > > > > commented out, I'm just not sure I understand how currentUser and
> the
> > > > merge
> > > > > are getting used.
> > > > >
> > > > >
> > > > > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > > > > kalle.o.korhonen@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > The examples lack comments because I strongly believe in
> > > > self-documenting
> > > > > > code. FederatedAccountService.federate() is the core concept of
> the
> > > > > > federated account module. Federated accounts module allows you to
> > > > > federate
> > > > > > (i.e. join, merge) separate accounts together. The implementation
> > of
> > > > this
> > > > > > CurrentUser is with the example code and a sample implementation
> > for
> > > > > restfb
> > > > > > remote account is:
> > > > > >     public void merge(com.restfb.types.User user) {
> > > > > >         username = user.getName();
> > > > > >         firstName = user.getFirstName();
> > > > > >         lastName = user.getLastName();
> > > > > >     }
> > > > > >
> > > > > > Any code example requires you to read the code but I'm not sure
> > how I
> > > > > could
> > > > > > change the code to highlight the possibilities better. Obviously,
> > > > what's
> > > > > > clear to me may not be so for others, so any suggestions for
> > > > improvements
> > > > > > are welcome.
> > > > > >
> > > > > > Kalle
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <
> chris@opencsta.org
> > >
> > > > > wrote:
> > > > > >
> > > > > > > CurrentUser.class
> > > > > > >
> > > > > > > Its a get method, probably on a hashtable-like object.  Getting
> > > > current
> > > > > > > user.
> > > > > > >
> > > > > > > The auth token is probably from the oauth2 provider like fb or
> > gg.
> > > > > > >
> > > > > > > With the current user and this token, merge them in *your* app.
> > > > > > >
> > > > > > > /guessing
> > > > > > > On 20/08/2014 7:05 am, "George Christman" <
> > gchristman@cardaddy.com
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > I guess I'm not following the logic of the code then. Why
> would
> > > > they
> > > > > be
> > > > > > > > passing CurrentUser into it then?
> > > > > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <
> > lance.java@googlemail.com
> > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > The ApplicationStateManager is a core Tapestry service and
> is
> > > an
> > > > > > > > > abstraction over HttpSession persistence. As stated in the
> > > > javadocs
> > > > > > > > > Application state is probably a bad choice of naming. In
> > > > hindsight
> > > > > it
> > > > > > > > > should probably be called SessionStateManager.
> > > > > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> > > > gchristman@cardaddy.com
> > > > > >
> > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Hi guys, I see this example of ApplicationStateManager
> > being
> > > > used
> > > > > > > with
> > > > > > > > > the
> > > > > > > > > > federatedaccounts example. line 20
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > > > > >
> > > > > > > > > > I've never seen it used before, so I was hoping someone
> > could
> > > > > > provide
> > > > > > > > > some
> > > > > > > > > > insight on what this code is actually doing and what the
> > > > purpose
> > > > > of
> > > > > > > > using
> > > > > > > > > >  ApplicationStateManager is.
> > > > > > > > > >
> > > > > > > > > > Thanks,
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > George Christman
> > > > > > > > > > www.CarDaddy.com
> > > > > > > > > > P.O. Box 735
> > > > > > > > > > Johnstown, New York
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > George Christman
> > > > > www.CarDaddy.com
> > > > > P.O. Box 735
> > > > > Johnstown, New York
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
For the time being I was able to somewhat get things working by adding the
js to my local META-INF directory. When I clicked the facebook link I
received a 400 error. Do you think this is a configuration error on my end,
or do you think it maybe a side effect of it not working in 5.4? I guess it
could also be a configuration issue within my facebook account too, I'm not
really sure yet. What are your thoughts?


On Thu, Aug 21, 2014 at 12:25 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> Unfortunately, I haven't updated federatedaccounts module to work with T5.4
> yet. It's pretty simple as tapestry-security already supports T5.4 but will
> be a week or two before I get to it because work's keeping me busy. Patches
> welcome of course.
>
> Kalle
>
>
> On Wed, Aug 20, 2014 at 4:53 PM, George Christman <gchristman@cardaddy.com
> >
> wrote:
>
> > Hi Kalle, I'm getting the following exception,
> >
> >
> >
> > *Unable to locate asset 'OauthSignIn.js' for component
> > registration/Signin:facebookoauthsignin. It should be located at
> > META-INF/assets/federated/OauthSignIn.js.*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *I'm using 5.4 and the following dependencies. Any thought why the
> > OauthSignin.js might be missing? Thanks. <dependency>
> > <groupId>org.tynamo</groupId>
> > <artifactId>tapestry-security</artifactId>
> > <version>0.5.1</version>        </dependency><dependency>
> > <groupId>org.tynamo.security</groupId>
> > <artifactId>tynamo-federatedaccounts-facebook</artifactId>
> > <version>0.4.3</version>        </dependency>
> > <dependency>            <groupId>org.tynamo.security</groupId>
> > <artifactId>tynamo-federatedaccounts-twitter</artifactId>
> > <version>0.4.3</version>        </dependency>
> > <dependency>            <groupId>org.tynamo.security</groupId>
> > <artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
> > <version>0.4.3</version>        </dependency>*
> >
> >
> > On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com
> > > wrote:
> >
> > > It's all sample code for typical use cases. For authentication, you
> need
> > to
> > > have (or Shiro needs to have) an AuthenticationInfo in session. That's
> > > where the principals and the credentials tokens are stored. Separately,
> > in
> > > your Tapestry application, you may have several (preferably light)
> > session
> > > objects for a user who may or may not have been authenticated, such as
> a
> > > shopping cart or a simple user object caching the most important user
> > > attributes as a performance optimization (in a database backed
> > > environment). In the case of this sample, you want to create or update
> > this
> > > user object from data obtained by the remote authentication provider.
> > >
> > > Kalle
> > >
> > >
> > > On Tue, Aug 19, 2014 at 7:38 PM, George Christman <
> > gchristman@cardaddy.com
> > > >
> > > wrote:
> > >
> > > > I think where I was confused was coming at this with the idea of
> > having a
> > > > database backed environment. I see your comments in CurrentUser.class
> > > > about ApplicationStateCreator
> > > > although I still don't fully understand it. I also seen some code
> where
> > > you
> > > > were commenting out
> > > > SimpleAuthenticationInfo where it takes currentUser. With that being
> > > > commented out, I'm just not sure I understand how currentUser and the
> > > merge
> > > > are getting used.
> > > >
> > > >
> > > > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > > > kalle.o.korhonen@gmail.com>
> > > > wrote:
> > > >
> > > > > The examples lack comments because I strongly believe in
> > > self-documenting
> > > > > code. FederatedAccountService.federate() is the core concept of the
> > > > > federated account module. Federated accounts module allows you to
> > > > federate
> > > > > (i.e. join, merge) separate accounts together. The implementation
> of
> > > this
> > > > > CurrentUser is with the example code and a sample implementation
> for
> > > > restfb
> > > > > remote account is:
> > > > >     public void merge(com.restfb.types.User user) {
> > > > >         username = user.getName();
> > > > >         firstName = user.getFirstName();
> > > > >         lastName = user.getLastName();
> > > > >     }
> > > > >
> > > > > Any code example requires you to read the code but I'm not sure
> how I
> > > > could
> > > > > change the code to highlight the possibilities better. Obviously,
> > > what's
> > > > > clear to me may not be so for others, so any suggestions for
> > > improvements
> > > > > are welcome.
> > > > >
> > > > > Kalle
> > > > >
> > > > >
> > > > >
> > > > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <chris@opencsta.org
> >
> > > > wrote:
> > > > >
> > > > > > CurrentUser.class
> > > > > >
> > > > > > Its a get method, probably on a hashtable-like object.  Getting
> > > current
> > > > > > user.
> > > > > >
> > > > > > The auth token is probably from the oauth2 provider like fb or
> gg.
> > > > > >
> > > > > > With the current user and this token, merge them in *your* app.
> > > > > >
> > > > > > /guessing
> > > > > > On 20/08/2014 7:05 am, "George Christman" <
> gchristman@cardaddy.com
> > >
> > > > > wrote:
> > > > > >
> > > > > > > I guess I'm not following the logic of the code then. Why would
> > > they
> > > > be
> > > > > > > passing CurrentUser into it then?
> > > > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <
> lance.java@googlemail.com
> > >
> > > > > wrote:
> > > > > > >
> > > > > > > > The ApplicationStateManager is a core Tapestry service and is
> > an
> > > > > > > > abstraction over HttpSession persistence. As stated in the
> > > javadocs
> > > > > > > > Application state is probably a bad choice of naming. In
> > > hindsight
> > > > it
> > > > > > > > should probably be called SessionStateManager.
> > > > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> > > gchristman@cardaddy.com
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi guys, I see this example of ApplicationStateManager
> being
> > > used
> > > > > > with
> > > > > > > > the
> > > > > > > > > federatedaccounts example. line 20
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > > > >
> > > > > > > > > I've never seen it used before, so I was hoping someone
> could
> > > > > provide
> > > > > > > > some
> > > > > > > > > insight on what this code is actually doing and what the
> > > purpose
> > > > of
> > > > > > > using
> > > > > > > > >  ApplicationStateManager is.
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > George Christman
> > > > > > > > > www.CarDaddy.com
> > > > > > > > > P.O. Box 735
> > > > > > > > > Johnstown, New York
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > George Christman
> > > > www.CarDaddy.com
> > > > P.O. Box 735
> > > > Johnstown, New York
> > > >
> > >
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by Kalle Korhonen <ka...@gmail.com>.
Unfortunately, I haven't updated federatedaccounts module to work with T5.4
yet. It's pretty simple as tapestry-security already supports T5.4 but will
be a week or two before I get to it because work's keeping me busy. Patches
welcome of course.

Kalle


On Wed, Aug 20, 2014 at 4:53 PM, George Christman <gc...@cardaddy.com>
wrote:

> Hi Kalle, I'm getting the following exception,
>
>
>
> *Unable to locate asset 'OauthSignIn.js' for component
> registration/Signin:facebookoauthsignin. It should be located at
> META-INF/assets/federated/OauthSignIn.js.*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *I'm using 5.4 and the following dependencies. Any thought why the
> OauthSignin.js might be missing? Thanks. <dependency>
> <groupId>org.tynamo</groupId>
> <artifactId>tapestry-security</artifactId>
> <version>0.5.1</version>        </dependency><dependency>
> <groupId>org.tynamo.security</groupId>
> <artifactId>tynamo-federatedaccounts-facebook</artifactId>
> <version>0.4.3</version>        </dependency>
> <dependency>            <groupId>org.tynamo.security</groupId>
> <artifactId>tynamo-federatedaccounts-twitter</artifactId>
> <version>0.4.3</version>        </dependency>
> <dependency>            <groupId>org.tynamo.security</groupId>
> <artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
> <version>0.4.3</version>        </dependency>*
>
>
> On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <
> kalle.o.korhonen@gmail.com
> > wrote:
>
> > It's all sample code for typical use cases. For authentication, you need
> to
> > have (or Shiro needs to have) an AuthenticationInfo in session. That's
> > where the principals and the credentials tokens are stored. Separately,
> in
> > your Tapestry application, you may have several (preferably light)
> session
> > objects for a user who may or may not have been authenticated, such as a
> > shopping cart or a simple user object caching the most important user
> > attributes as a performance optimization (in a database backed
> > environment). In the case of this sample, you want to create or update
> this
> > user object from data obtained by the remote authentication provider.
> >
> > Kalle
> >
> >
> > On Tue, Aug 19, 2014 at 7:38 PM, George Christman <
> gchristman@cardaddy.com
> > >
> > wrote:
> >
> > > I think where I was confused was coming at this with the idea of
> having a
> > > database backed environment. I see your comments in CurrentUser.class
> > > about ApplicationStateCreator
> > > although I still don't fully understand it. I also seen some code where
> > you
> > > were commenting out
> > > SimpleAuthenticationInfo where it takes currentUser. With that being
> > > commented out, I'm just not sure I understand how currentUser and the
> > merge
> > > are getting used.
> > >
> > >
> > > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > > kalle.o.korhonen@gmail.com>
> > > wrote:
> > >
> > > > The examples lack comments because I strongly believe in
> > self-documenting
> > > > code. FederatedAccountService.federate() is the core concept of the
> > > > federated account module. Federated accounts module allows you to
> > > federate
> > > > (i.e. join, merge) separate accounts together. The implementation of
> > this
> > > > CurrentUser is with the example code and a sample implementation for
> > > restfb
> > > > remote account is:
> > > >     public void merge(com.restfb.types.User user) {
> > > >         username = user.getName();
> > > >         firstName = user.getFirstName();
> > > >         lastName = user.getLastName();
> > > >     }
> > > >
> > > > Any code example requires you to read the code but I'm not sure how I
> > > could
> > > > change the code to highlight the possibilities better. Obviously,
> > what's
> > > > clear to me may not be so for others, so any suggestions for
> > improvements
> > > > are welcome.
> > > >
> > > > Kalle
> > > >
> > > >
> > > >
> > > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <ch...@opencsta.org>
> > > wrote:
> > > >
> > > > > CurrentUser.class
> > > > >
> > > > > Its a get method, probably on a hashtable-like object.  Getting
> > current
> > > > > user.
> > > > >
> > > > > The auth token is probably from the oauth2 provider like fb or gg.
> > > > >
> > > > > With the current user and this token, merge them in *your* app.
> > > > >
> > > > > /guessing
> > > > > On 20/08/2014 7:05 am, "George Christman" <gchristman@cardaddy.com
> >
> > > > wrote:
> > > > >
> > > > > > I guess I'm not following the logic of the code then. Why would
> > they
> > > be
> > > > > > passing CurrentUser into it then?
> > > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <lance.java@googlemail.com
> >
> > > > wrote:
> > > > > >
> > > > > > > The ApplicationStateManager is a core Tapestry service and is
> an
> > > > > > > abstraction over HttpSession persistence. As stated in the
> > javadocs
> > > > > > > Application state is probably a bad choice of naming. In
> > hindsight
> > > it
> > > > > > > should probably be called SessionStateManager.
> > > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> > gchristman@cardaddy.com
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > Hi guys, I see this example of ApplicationStateManager being
> > used
> > > > > with
> > > > > > > the
> > > > > > > > federatedaccounts example. line 20
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > > >
> > > > > > > > I've never seen it used before, so I was hoping someone could
> > > > provide
> > > > > > > some
> > > > > > > > insight on what this code is actually doing and what the
> > purpose
> > > of
> > > > > > using
> > > > > > > >  ApplicationStateManager is.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > George Christman
> > > > > > > > www.CarDaddy.com
> > > > > > > > P.O. Box 735
> > > > > > > > Johnstown, New York
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
Hi Kalle, I'm getting the following exception,



*Unable to locate asset 'OauthSignIn.js' for component
registration/Signin:facebookoauthsignin. It should be located at
META-INF/assets/federated/OauthSignIn.js.*

























*I'm using 5.4 and the following dependencies. Any thought why the
OauthSignin.js might be missing? Thanks. <dependency>
<groupId>org.tynamo</groupId>
<artifactId>tapestry-security</artifactId>
<version>0.5.1</version>        </dependency><dependency>
<groupId>org.tynamo.security</groupId>
<artifactId>tynamo-federatedaccounts-facebook</artifactId>
<version>0.4.3</version>        </dependency>
<dependency>            <groupId>org.tynamo.security</groupId>
<artifactId>tynamo-federatedaccounts-twitter</artifactId>
<version>0.4.3</version>        </dependency>
<dependency>            <groupId>org.tynamo.security</groupId>
<artifactId>tynamo-federatedaccounts-pac4jbasedoauth</artifactId>
<version>0.4.3</version>        </dependency>*


On Wed, Aug 20, 2014 at 12:45 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> It's all sample code for typical use cases. For authentication, you need to
> have (or Shiro needs to have) an AuthenticationInfo in session. That's
> where the principals and the credentials tokens are stored. Separately, in
> your Tapestry application, you may have several (preferably light) session
> objects for a user who may or may not have been authenticated, such as a
> shopping cart or a simple user object caching the most important user
> attributes as a performance optimization (in a database backed
> environment). In the case of this sample, you want to create or update this
> user object from data obtained by the remote authentication provider.
>
> Kalle
>
>
> On Tue, Aug 19, 2014 at 7:38 PM, George Christman <gchristman@cardaddy.com
> >
> wrote:
>
> > I think where I was confused was coming at this with the idea of having a
> > database backed environment. I see your comments in CurrentUser.class
> > about ApplicationStateCreator
> > although I still don't fully understand it. I also seen some code where
> you
> > were commenting out
> > SimpleAuthenticationInfo where it takes currentUser. With that being
> > commented out, I'm just not sure I understand how currentUser and the
> merge
> > are getting used.
> >
> >
> > On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com>
> > wrote:
> >
> > > The examples lack comments because I strongly believe in
> self-documenting
> > > code. FederatedAccountService.federate() is the core concept of the
> > > federated account module. Federated accounts module allows you to
> > federate
> > > (i.e. join, merge) separate accounts together. The implementation of
> this
> > > CurrentUser is with the example code and a sample implementation for
> > restfb
> > > remote account is:
> > >     public void merge(com.restfb.types.User user) {
> > >         username = user.getName();
> > >         firstName = user.getFirstName();
> > >         lastName = user.getLastName();
> > >     }
> > >
> > > Any code example requires you to read the code but I'm not sure how I
> > could
> > > change the code to highlight the possibilities better. Obviously,
> what's
> > > clear to me may not be so for others, so any suggestions for
> improvements
> > > are welcome.
> > >
> > > Kalle
> > >
> > >
> > >
> > > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <ch...@opencsta.org>
> > wrote:
> > >
> > > > CurrentUser.class
> > > >
> > > > Its a get method, probably on a hashtable-like object.  Getting
> current
> > > > user.
> > > >
> > > > The auth token is probably from the oauth2 provider like fb or gg.
> > > >
> > > > With the current user and this token, merge them in *your* app.
> > > >
> > > > /guessing
> > > > On 20/08/2014 7:05 am, "George Christman" <gc...@cardaddy.com>
> > > wrote:
> > > >
> > > > > I guess I'm not following the logic of the code then. Why would
> they
> > be
> > > > > passing CurrentUser into it then?
> > > > > On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com>
> > > wrote:
> > > > >
> > > > > > The ApplicationStateManager is a core Tapestry service and is an
> > > > > > abstraction over HttpSession persistence. As stated in the
> javadocs
> > > > > > Application state is probably a bad choice of naming. In
> hindsight
> > it
> > > > > > should probably be called SessionStateManager.
> > > > > >  On 19 Aug 2014 21:04, "George Christman" <
> gchristman@cardaddy.com
> > >
> > > > > wrote:
> > > > > >
> > > > > > > Hi guys, I see this example of ApplicationStateManager being
> used
> > > > with
> > > > > > the
> > > > > > > federatedaccounts example. line 20
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > > >
> > > > > > > I've never seen it used before, so I was hoping someone could
> > > provide
> > > > > > some
> > > > > > > insight on what this code is actually doing and what the
> purpose
> > of
> > > > > using
> > > > > > >  ApplicationStateManager is.
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > George Christman
> > > > > > > www.CarDaddy.com
> > > > > > > P.O. Box 735
> > > > > > > Johnstown, New York
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by Kalle Korhonen <ka...@gmail.com>.
It's all sample code for typical use cases. For authentication, you need to
have (or Shiro needs to have) an AuthenticationInfo in session. That's
where the principals and the credentials tokens are stored. Separately, in
your Tapestry application, you may have several (preferably light) session
objects for a user who may or may not have been authenticated, such as a
shopping cart or a simple user object caching the most important user
attributes as a performance optimization (in a database backed
environment). In the case of this sample, you want to create or update this
user object from data obtained by the remote authentication provider.

Kalle


On Tue, Aug 19, 2014 at 7:38 PM, George Christman <gc...@cardaddy.com>
wrote:

> I think where I was confused was coming at this with the idea of having a
> database backed environment. I see your comments in CurrentUser.class
> about ApplicationStateCreator
> although I still don't fully understand it. I also seen some code where you
> were commenting out
> SimpleAuthenticationInfo where it takes currentUser. With that being
> commented out, I'm just not sure I understand how currentUser and the merge
> are getting used.
>
>
> On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <
> kalle.o.korhonen@gmail.com>
> wrote:
>
> > The examples lack comments because I strongly believe in self-documenting
> > code. FederatedAccountService.federate() is the core concept of the
> > federated account module. Federated accounts module allows you to
> federate
> > (i.e. join, merge) separate accounts together. The implementation of this
> > CurrentUser is with the example code and a sample implementation for
> restfb
> > remote account is:
> >     public void merge(com.restfb.types.User user) {
> >         username = user.getName();
> >         firstName = user.getFirstName();
> >         lastName = user.getLastName();
> >     }
> >
> > Any code example requires you to read the code but I'm not sure how I
> could
> > change the code to highlight the possibilities better. Obviously, what's
> > clear to me may not be so for others, so any suggestions for improvements
> > are welcome.
> >
> > Kalle
> >
> >
> >
> > On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <ch...@opencsta.org>
> wrote:
> >
> > > CurrentUser.class
> > >
> > > Its a get method, probably on a hashtable-like object.  Getting current
> > > user.
> > >
> > > The auth token is probably from the oauth2 provider like fb or gg.
> > >
> > > With the current user and this token, merge them in *your* app.
> > >
> > > /guessing
> > > On 20/08/2014 7:05 am, "George Christman" <gc...@cardaddy.com>
> > wrote:
> > >
> > > > I guess I'm not following the logic of the code then. Why would they
> be
> > > > passing CurrentUser into it then?
> > > > On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com>
> > wrote:
> > > >
> > > > > The ApplicationStateManager is a core Tapestry service and is an
> > > > > abstraction over HttpSession persistence. As stated in the javadocs
> > > > > Application state is probably a bad choice of naming. In hindsight
> it
> > > > > should probably be called SessionStateManager.
> > > > >  On 19 Aug 2014 21:04, "George Christman" <gchristman@cardaddy.com
> >
> > > > wrote:
> > > > >
> > > > > > Hi guys, I see this example of ApplicationStateManager being used
> > > with
> > > > > the
> > > > > > federatedaccounts example. line 20
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > > >
> > > > > > I've never seen it used before, so I was hoping someone could
> > provide
> > > > > some
> > > > > > insight on what this code is actually doing and what the purpose
> of
> > > > using
> > > > > >  ApplicationStateManager is.
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > >
> > > > > > --
> > > > > > George Christman
> > > > > > www.CarDaddy.com
> > > > > > P.O. Box 735
> > > > > > Johnstown, New York
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
I think where I was confused was coming at this with the idea of having a
database backed environment. I see your comments in CurrentUser.class
about ApplicationStateCreator
although I still don't fully understand it. I also seen some code where you
were commenting out
SimpleAuthenticationInfo where it takes currentUser. With that being
commented out, I'm just not sure I understand how currentUser and the merge
are getting used.


On Tue, Aug 19, 2014 at 7:48 PM, Kalle Korhonen <ka...@gmail.com>
wrote:

> The examples lack comments because I strongly believe in self-documenting
> code. FederatedAccountService.federate() is the core concept of the
> federated account module. Federated accounts module allows you to federate
> (i.e. join, merge) separate accounts together. The implementation of this
> CurrentUser is with the example code and a sample implementation for restfb
> remote account is:
>     public void merge(com.restfb.types.User user) {
>         username = user.getName();
>         firstName = user.getFirstName();
>         lastName = user.getLastName();
>     }
>
> Any code example requires you to read the code but I'm not sure how I could
> change the code to highlight the possibilities better. Obviously, what's
> clear to me may not be so for others, so any suggestions for improvements
> are welcome.
>
> Kalle
>
>
>
> On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <ch...@opencsta.org> wrote:
>
> > CurrentUser.class
> >
> > Its a get method, probably on a hashtable-like object.  Getting current
> > user.
> >
> > The auth token is probably from the oauth2 provider like fb or gg.
> >
> > With the current user and this token, merge them in *your* app.
> >
> > /guessing
> > On 20/08/2014 7:05 am, "George Christman" <gc...@cardaddy.com>
> wrote:
> >
> > > I guess I'm not following the logic of the code then. Why would they be
> > > passing CurrentUser into it then?
> > > On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com>
> wrote:
> > >
> > > > The ApplicationStateManager is a core Tapestry service and is an
> > > > abstraction over HttpSession persistence. As stated in the javadocs
> > > > Application state is probably a bad choice of naming. In hindsight it
> > > > should probably be called SessionStateManager.
> > > >  On 19 Aug 2014 21:04, "George Christman" <gc...@cardaddy.com>
> > > wrote:
> > > >
> > > > > Hi guys, I see this example of ApplicationStateManager being used
> > with
> > > > the
> > > > > federatedaccounts example. line 20
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > > >
> > > > > I've never seen it used before, so I was hoping someone could
> provide
> > > > some
> > > > > insight on what this code is actually doing and what the purpose of
> > > using
> > > > >  ApplicationStateManager is.
> > > > >
> > > > > Thanks,
> > > > >
> > > > >
> > > > > --
> > > > > George Christman
> > > > > www.CarDaddy.com
> > > > > P.O. Box 735
> > > > > Johnstown, New York
> > > > >
> > > >
> > >
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Tynamo ApplicationStateManager Example

Posted by Kalle Korhonen <ka...@gmail.com>.
The examples lack comments because I strongly believe in self-documenting
code. FederatedAccountService.federate() is the core concept of the
federated account module. Federated accounts module allows you to federate
(i.e. join, merge) separate accounts together. The implementation of this
CurrentUser is with the example code and a sample implementation for restfb
remote account is:
    public void merge(com.restfb.types.User user) {
        username = user.getName();
        firstName = user.getFirstName();
        lastName = user.getLastName();
    }

Any code example requires you to read the code but I'm not sure how I could
change the code to highlight the possibilities better. Obviously, what's
clear to me may not be so for others, so any suggestions for improvements
are welcome.

Kalle



On Tue, Aug 19, 2014 at 2:32 PM, Chris Mylonas <ch...@opencsta.org> wrote:

> CurrentUser.class
>
> Its a get method, probably on a hashtable-like object.  Getting current
> user.
>
> The auth token is probably from the oauth2 provider like fb or gg.
>
> With the current user and this token, merge them in *your* app.
>
> /guessing
> On 20/08/2014 7:05 am, "George Christman" <gc...@cardaddy.com> wrote:
>
> > I guess I'm not following the logic of the code then. Why would they be
> > passing CurrentUser into it then?
> > On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com> wrote:
> >
> > > The ApplicationStateManager is a core Tapestry service and is an
> > > abstraction over HttpSession persistence. As stated in the javadocs
> > > Application state is probably a bad choice of naming. In hindsight it
> > > should probably be called SessionStateManager.
> > >  On 19 Aug 2014 21:04, "George Christman" <gc...@cardaddy.com>
> > wrote:
> > >
> > > > Hi guys, I see this example of ApplicationStateManager being used
> with
> > > the
> > > > federatedaccounts example. line 20
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > > >
> > > > I've never seen it used before, so I was hoping someone could provide
> > > some
> > > > insight on what this code is actually doing and what the purpose of
> > using
> > > >  ApplicationStateManager is.
> > > >
> > > > Thanks,
> > > >
> > > >
> > > > --
> > > > George Christman
> > > > www.CarDaddy.com
> > > > P.O. Box 735
> > > > Johnstown, New York
> > > >
> > >
> >
>

Re: Tynamo ApplicationStateManager Example

Posted by Chris Mylonas <ch...@opencsta.org>.
CurrentUser.class

Its a get method, probably on a hashtable-like object.  Getting current
user.

The auth token is probably from the oauth2 provider like fb or gg.

With the current user and this token, merge them in *your* app.

/guessing
On 20/08/2014 7:05 am, "George Christman" <gc...@cardaddy.com> wrote:

> I guess I'm not following the logic of the code then. Why would they be
> passing CurrentUser into it then?
> On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com> wrote:
>
> > The ApplicationStateManager is a core Tapestry service and is an
> > abstraction over HttpSession persistence. As stated in the javadocs
> > Application state is probably a bad choice of naming. In hindsight it
> > should probably be called SessionStateManager.
> >  On 19 Aug 2014 21:04, "George Christman" <gc...@cardaddy.com>
> wrote:
> >
> > > Hi guys, I see this example of ApplicationStateManager being used with
> > the
> > > federatedaccounts example. line 20
> > >
> > >
> > >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> > >
> > > I've never seen it used before, so I was hoping someone could provide
> > some
> > > insight on what this code is actually doing and what the purpose of
> using
> > >  ApplicationStateManager is.
> > >
> > > Thanks,
> > >
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> >
>

Re: Tynamo ApplicationStateManager Example

Posted by George Christman <gc...@cardaddy.com>.
I guess I'm not following the logic of the code then. Why would they be
passing CurrentUser into it then?
On Aug 19, 2014 4:46 PM, "Lance Java" <la...@googlemail.com> wrote:

> The ApplicationStateManager is a core Tapestry service and is an
> abstraction over HttpSession persistence. As stated in the javadocs
> Application state is probably a bad choice of naming. In hindsight it
> should probably be called SessionStateManager.
>  On 19 Aug 2014 21:04, "George Christman" <gc...@cardaddy.com> wrote:
>
> > Hi guys, I see this example of ApplicationStateManager being used with
> the
> > federatedaccounts example. line 20
> >
> >
> >
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
> >
> > I've never seen it used before, so I was hoping someone could provide
> some
> > insight on what this code is actually doing and what the purpose of using
> >  ApplicationStateManager is.
> >
> > Thanks,
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>

Re: Tynamo ApplicationStateManager Example

Posted by Lance Java <la...@googlemail.com>.
The ApplicationStateManager is a core Tapestry service and is an
abstraction over HttpSession persistence. As stated in the javadocs
Application state is probably a bad choice of naming. In hindsight it
should probably be called SessionStateManager.
 On 19 Aug 2014 21:04, "George Christman" <gc...@cardaddy.com> wrote:

> Hi guys, I see this example of ApplicationStateManager being used with the
> federatedaccounts example. line 20
>
>
> https://github.com/tynamo/tynamo-example-federatedaccounts/blob/master/src/main/java/org/tynamo/examples/federatedaccounts/services/FederatedAccountServiceExample.java
>
> I've never seen it used before, so I was hoping someone could provide some
> insight on what this code is actually doing and what the purpose of using
>  ApplicationStateManager is.
>
> Thanks,
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>