I want to modify the authentication behavior so that the whole process can be done through the customer towards xhr. So, for example, when I wish to greet the login form login_handler, instead of loading new HTML pages, will return some JSN data of success and error or any kind of redirects what should I do to do this?
You must be able to write your own login controller and call the identifier and recall method.
Recover your user from the database first, validate the password and then if everything is correct you can set the authentication cookie:
response .headers = request.environ [repoze.who.plugins'] ['main_identifier'] Remember (request.enver, {'repoze.who.userid': user_name}) Other than confirming success for a JSON dict back UI object from the controller
Comments
Post a Comment