How to use web_user module


(Josías) #1

Hi,

I would like to know how web_user module works or how to use it. I’m not sure if these module is designed to external auth or to login inside tryton?

Thanks in advance!


(Sergi Almacellas Abellana) #2

This module is used to manage autentication of web interfaces users. It can be used with flask_tryton to develop customer portals or webshops.


(Josías) #3

Today I was trying the module. First I configured trytond.conf email section Configuration file for Tryton — trytond 5.1 documentation and after installing I was trying the validate_password and reset_password buttons, but I receive the follows message:

Traceback (most recent call last):
File “/opt/lib/python37/site-packages/trytond/wsgipy”, line 73, in dispatch_request
return endpoint(request, **requestview_args)
File “/opt/lib/python37/site-packages/trytond/protocols/dispatcherpy”, line 46, in rpc
request, database_name, *requestrpc_params)
File “/opt/lib/python37/site-packages/trytond/wsgipy”, line 44, in auth_required
return wrapped(*args, **kwargs)
File “/opt/lib/python37/site-packages/trytond/protocols/wrapperspy”, line 122, in wrapper
return func(request, pool, *args, **kwargs)
File “/opt/lib/python37/site-packages/trytond/protocols/dispatcherpy”, line 199, in _dispatch
transactioncommit()
File “/opt/lib/python37/site-packages/trytond/transactionpy”, line 209, in commit
datamanagertpc_vote(self)
File “/opt/lib/python37/site-packages/trytond/sendmailpy”, line 94, in tpc_vote
self_server = get_smtp_server(selfuri)
File “/opt/lib/python37/site-packages/trytond/sendmailpy”, line 55, in get_smtp_server
server = smtplibSMTP(urihostname, uriport, **extra)
File “/usr/lib/python37/smtplibpy”, line 251, in init
(code, msg) = selfconnect(host, port)
File “/usr/lib/python37/smtplibpy”, line 335, in connect
selfsock = self_get_socket(host, port, selftimeout)
File “/usr/lib/python37/smtplibpy”, line 306, in _get_socket
selfsource_address)
File “/usr/lib/python37/socketpy”, line 712, in create_connection
raise err
File “/usr/lib/python37/socketpy”, line 703, in create_connection
sockconnect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Did I forget some configuration to try the module?


(Cédric Krier) #4

The email configuration is not correctly setup: Configuration file for Tryton — trytond 5.1 documentation


(Josías) #5

Thanks, I fixed it using the correct uri for email.


(Josías) #6

In the main config file of tryton, I need to define reset_password_url and email_validation_url (Web User Module — trytond_web_user latest documentation), the url is the same that tryton server? Or I need to define it from a third web application? If not, how I need to define the correct url?


(Cédric Krier) #7

You have to set them to point to specific entrypoint on your website. Those entrypoint will have to call the proper methods, respectively: set_password_url and validate_email_url or set_password_token and validate_email_token.