Hi Joe
It does sound like you are making some progress - getting rid of all the
persona stuff makes sense and I would like dual login capability as well.
However my knowledge of both web2py auth and social auth is very limited
so I am not sure I am a great source of advice. I did get Janrain and
web2py logins working together in a fashon a while back and I think this is
still covered in the book with ExtendedLoginForm so this MIGHT be a useful
part of a way forward - code snippet below. The other big limitation it
currently has is that for some providers eg google it is not pulling in the
users email address and if email is required by your app that is a problem.
I think that is in part the way google wants it to work and you are
supposed to authenticate and then make an API call to get the email address
which I think is the sort of thing the pipeline should do.- but I haven't
even made an attempt to figure out what is involved in doing this.
Donald
elif login == 'web2pyandjanrain':
from gluon.contrib.login_methods.extended_login_form import
ExtendedLoginForm
from gluon.contrib.login_methods.rpx_account import RPXAccount
filename = 'private/janrain.key'
path = os.path.join(current.request.folder, filename)
if os.path.exists(path):
request = current.request
domain, key = open(path, 'r').read().strip().split(':')
host = current.request.env.http_host
url = URL('default', 'user', args='login', scheme=True)
other_form = RPXAccount(request, api_key=key, domain=domain, url=url)
auth.settings.login_form = ExtendedLoginForm(auth, other_form,
signals=['token'])
On Friday, February 17, 2017 at 2:17:10 AM UTC, Joe Barnhart wrote:
>
> Hi Dan --
>
> I've been playing with it awhile. It seems the Mozilla "persona" feature
> got permeated throughout the plug-in. Which is unfortunate since persona
> is now room-temperature, making all that code into bloat. I'm trying to
> prune through it, but confusingly much of the javascript stuff seems to
> completely go away. Still having a bit of fun grokking all the javascript
> and its interaction with the built-in forms.
>
> Since I need both social auth and web2py auth, the plug-in as it stands is
> not usable. My thoughts are, either I pare it down and just get the code
> that does the actual social auth stuff or I try to augment the plugin and
> remove Persona and add web2py auth to it. My vision is a combined auth
> form that has the web2py "username/password" at the top and a row of
> buttons for social logon at the bottom.
>
>
> <https://lh3.googleusercontent.com/-wfp7IjUMZCI/WKZcsa2KECI/AAAAAAAAAnM/E2QugZa2ytc6QAi60ylxnpm9Jy5iszp5gCLcB/s1600/Login.tiff>
>
>
> What are your thoughts?
>
> -- Joe
>
>
> On Saturday, February 11, 2017 at 9:35:53 AM UTC-8, Donald McClymont wrote:
>>
>> Hi Joe
>>
>> The repo is a minimum Web2py app with most of the code in a plug-in so as
>> long as you have social-auth-core installed it should run ok. However I am
>> not sure if you can fully setup and test from a laptop. Most of the
>> providers that you need to register your app with seem to like you to list
>> valid web addresses rather than localhost or the like. So I ended up
>> testing on pythonanywhere and then if you go for a free account you would
>> need to check carefully if the referred providers are on your whitelist.
>>
>> There has also been a new release of social-auth-core 1.1 since I tested
>> but hopefully that doesn't cause any issues
>>
>> Regards
>> Donald
>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.