I am changing the login authentication to be handled by AWS Cognito and require some clarification around the approach as cannot get it to work correctly
auth.settings.login_methods = [cog_login]
One of the functions that is in the class is called authenticate() that takes username and password arguments that the user enters from the standard web2py forms user/login
In the def user() controller in default I have the following:
cog_login().authenticate(request.vars.email, request.vars.password)
This queries AWS and returns True if passes, False otherwise.
I am not clear on what to do with the True, False response within the def user() as it doesn't seem to populate auth.user which always remains as None.
I have tried to force the population of auth.user getting the contents of auth_user, i.e. auth.user = row[0]. This does populate auth.user performing tests auth.is_logged_in() results in a True response.
However when continuing through the def user() the standard onlogin redirect doesn't forward to the main page indicating web2py isnt recording this as authentication accepted.
Is this approach correct, I seem to be missing a step that knits the successful AWS login to Web2py
--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.