ERP-Ukraine / odoo-rpc-dart

Odoo RPC Library for Dart
MIT License
43 stars 32 forks source link

If login via RPC, and when I call webview of odoo. can I access that webview without anymore login again? #16

Closed function2000 closed 3 years ago

function2000 commented 3 years ago

I am uring RPC now, we know we can access odoo via RPC login. But I also want to use flutter_webview_plugin to visit one backend page, normally we need to login the web again. Is there someway to not login the web again?

Or must I use Single Sign on? Is it possible to do somehow via RPC etc. Thanks a lot!

lem8r commented 3 years ago

I doubt it will work. To be logged in you need session id in cookies. But for rpc calls session id is updated on every call. You can't use session obtained from rpc as it will be expired on next rpc call.

There is session stream that yields new session id for each call so you can save it for next app launch https://github.com/ERP-Ukraine/odoo-rpc-dart/blob/master/example/odoo_rpc_example.dart#L29

You may try to use it and set it to cookie of web view if it is possible.

function2000 commented 3 years ago

I doubt it will work. To be logged in you need session id in cookies. But for rpc calls session id is updated on every call. You can't use session obtained from rpc as it will be expired on next rpc call.

There is session stream that yields new session id for each call so you can save it for next app launch https://github.com/ERP-Ukraine/odoo-rpc-dart/blob/master/example/odoo_rpc_example.dart#L29

You may try to use it and set it to cookie of web view if it is possible.

I think I am weak in this area. Can you please try it? if it would be great that it works. Thank you very very much!

lem8r commented 3 years ago

Sorry, it is not related to rpc module at all.