librelist archives

« back to archive

flask -openid

flask -openid

From:
bally boy
Date:
2010-10-15 @ 03:20
Hi I was trying to implement flask openid on one of my websites which I am
building using Flask.The experience has been great giving me a total control
of what I am doing unlike in many other frameworks..However this is what I
want to know:-

 The default store used in flask openid is the filesystem. I would want to
use either the db or memcache in GAE as the store.The docs dont talk about
this. Could somebody tell me , how could I do this.

Thanks a lot!

Re: flask -openid

From:
bally boy
Date:
2010-10-15 @ 03:41
Ok so this I what I understood, I would have to write a function for using
memcached or dbase as the store and use it to instantiate the openid object.
Am I wrong?.
Could somebody please let me know if they have written any function like
this.

On Fri, Oct 15, 2010 at 8:50 AM, bally boy <ballyboy40@gmail.com> wrote:

> Hi I was trying to implement flask openid on one of my websites which I am
> building using Flask.The experience has been great giving me a total control
> of what I am doing unlike in many other frameworks..However this is what I
> want to know:-
>
>  The default store used in flask openid is the filesystem. I would want to
> use either the db or memcache in GAE as the store.The docs dont talk about
> this. Could somebody tell me , how could I do this.
>
> Thanks a lot!
>
>
>

Re: flask -openid

From:
bally boy
Date:
2010-10-15 @ 03:48
I guess I got it, would this do the job:-

from flaskext.openid import OpenID
oid = OpenID(app, store_factory=memstore.MemoryStore())

Please let me know if this is wrong.

On Fri, Oct 15, 2010 at 9:11 AM, bally boy <ballyboy40@gmail.com> wrote:

> Ok so this I what I understood, I would have to write a function for using
> memcached or dbase as the store and use it to instantiate the openid object.
> Am I wrong?.
> Could somebody please let me know if they have written any function like
> this.
>
>
> On Fri, Oct 15, 2010 at 8:50 AM, bally boy <ballyboy40@gmail.com> wrote:
>
>> Hi I was trying to implement flask openid on one of my websites which I am
>> building using Flask.The experience has been great giving me a total control
>> of what I am doing unlike in many other frameworks..However this is what I
>> want to know:-
>>
>>  The default store used in flask openid is the filesystem. I would want to
>> use either the db or memcache in GAE as the store.The docs dont talk about
>> this. Could somebody tell me , how could I do this.
>>
>> Thanks a lot!
>>
>>
>>
>
>

Re: [flask] Re: flask -openid

From:
Armin Ronacher
Date:
2010-10-15 @ 08:57
Hi,

On 2010-10-15 5:48 AM, bally boy wrote:
> I guess I got it, would this do the job:-
>
> from flaskext.openid import OpenID
> oid = OpenID(app, store_factory=memstore.MemoryStore())
>
> Please let me know if this is wrong.
Won't work, because the memory is not necessarily persistent in GAE. 
You will have to write your own store that writes to GAE's datastore.

Here is an example of how such an implementation could look like.  This 
one is using a relational database: http://bit.ly/c6WFTY


Regards,
Armin

Re: [flask] Re: flask -openid

From:
bally boy
Date:
2010-10-15 @ 12:09
Hi Thanks for replying , I used this for implementing the store
http://tinyurl.com/23o5nzu . and created the Association and Nonce Table in
the models file in my app.
*While it works fine now,it does not accept gmail addresses as open id. I
mean if I give say flask@gmail.com as open id , it does not accept it. I
have used gmail address as openid on stackoverflow. Am I missing something
again here.*
*
*
On Fri, Oct 15, 2010 at 2:27 PM, Armin Ronacher <armin.ronacher@active-4.com
> wrote:

> Hi,
>
> On 2010-10-15 5:48 AM, bally boy wrote:
> > I guess I got it, would this do the job:-
> >
> > from flaskext.openid import OpenID
> > oid = OpenID(app, store_factory=memstore.MemoryStore())
> >
> > Please let me know if this is wrong.
> Won't work, because the memory is not necessarily persistent in GAE.
> You will have to write your own store that writes to GAE's datastore.
>
> Here is an example of how such an implementation could look like.  This
> one is using a relational database: http://bit.ly/c6WFTY
>
>
> Regards,
> Armin
>

Re: [flask] Re: flask -openid

From:
Ronny Pfannschmidt
Date:
2010-10-15 @ 13:12
On Fri, 2010-10-15 at 17:39 +0530, bally boy wrote:
> Hi Thanks for replying , I used this for implementing the
> store http://tinyurl.com/23o5nzu . and created the Association and
> Nonce Table in the models file in my app.
> While it works fine now,it does not accept gmail addresses as open id.
> I mean if I give say flask@gmail.com as open id , it does not accept
> it. I have used gmail address as openid on stackoverflow. Am I missing
> something again here.

openid works with url endpoints, not email addresses

google has a openid endpoint (which is whats actually used for
stackoverflow)
> 
> 
> On Fri, Oct 15, 2010 at 2:27 PM, Armin Ronacher
> <armin.ronacher@active-4.com> wrote:
>         Hi,
>         
>         On 2010-10-15 5:48 AM, bally boy wrote:
>         > I guess I got it, would this do the job:-
>         >
>         > from flaskext.openid import OpenID
>         > oid = OpenID(app, store_factory=memstore.MemoryStore())
>         >
>         > Please let me know if this is wrong.
>         
>         Won't work, because the memory is not necessarily persistent
>         in GAE.
>         You will have to write your own store that writes to GAE's
>         datastore.
>         
>         Here is an example of how such an implementation could look
>         like.  This
>         one is using a relational database: http://bit.ly/c6WFTY
>         
>         
>         Regards,
>         Armin
> 
> 

Re: [flask] Re: flask -openid

From:
bally boy
Date:
2010-10-15 @ 14:07
Thanks Ronny,Got it!

On Fri, Oct 15, 2010 at 6:42 PM, Ronny Pfannschmidt <
Ronny.Pfannschmidt@gmx.de> wrote:

> On Fri, 2010-10-15 at 17:39 +0530, bally boy wrote:
> > Hi Thanks for replying , I used this for implementing the
> > store http://tinyurl.com/23o5nzu . and created the Association and
> > Nonce Table in the models file in my app.
> > While it works fine now,it does not accept gmail addresses as open id.
> > I mean if I give say flask@gmail.com as open id , it does not accept
> > it. I have used gmail address as openid on stackoverflow. Am I missing
> > something again here.
>
> openid works with url endpoints, not email addresses
>
> google has a openid endpoint (which is whats actually used for
> stackoverflow)
> >
> >
> > On Fri, Oct 15, 2010 at 2:27 PM, Armin Ronacher
> > <armin.ronacher@active-4.com> wrote:
> >         Hi,
> >
> >         On 2010-10-15 5:48 AM, bally boy wrote:
> >         > I guess I got it, would this do the job:-
> >         >
> >         > from flaskext.openid import OpenID
> >         > oid = OpenID(app, store_factory=memstore.MemoryStore())
> >         >
> >         > Please let me know if this is wrong.
> >
> >         Won't work, because the memory is not necessarily persistent
> >         in GAE.
> >         You will have to write your own store that writes to GAE's
> >         datastore.
> >
> >         Here is an example of how such an implementation could look
> >         like.  This
> >         one is using a relational database: http://bit.ly/c6WFTY
> >
> >
> >         Regards,
> >         Armin
> >
> >
>
>