How to use web_user module

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!

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

Today I was trying the module. First I configured trytond.conf email section Configuration file for Tryton — trytond 5.3 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?

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

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

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?

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.

I still don’t get how to connect to the REMOTE server?

# /etc/trytond.conf

[email]
uri = smtps://<name>:<pass>@smtp.a-very-private-mail-server.com:465

I tried this configuration, but I feel I need to drill into Tryton source code to understand how to set up SMTP/SSL connection…

In the doc no such case discussed
Would you help me or point me out where these details described?

Constantine.

You should use something like
uri = smtp+tls://user:pass@email-smtp.us.com:587

1 Like

Using MS 365 Exhange Online if anyone is using Exchange online the setting options are in this article.

Option 1 (recommended): Authenticate your device or application directly with a Microsoft 365 or Office 365 mailbox, and send mail using SMTP AUTH client submission

Works like a magic!

uri = smtp+tls://info:<PASS>@mail.mailserver.com:587

TESTED with command:

trytond-admin --test-email <my_email>@gmail.com --logconf /etc/trytond.log.conf -c /etc/trytond.conf -d tryton | grep -v INFO 

I used grep -v INFO to skip info of the administration console…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.