Under construction... Feel free to raise issue if you find one!
This plugin utilizes Casdoor's OAuth function to log in Odoo for convenience.
View the Odoo module
-
You need to setup the Odoo instance on your host server, for this step, please reference the latest official Odoo setup tutorial. Make sure you can correctly setup the Odoo instance before proceeding to next step.
-
Then you need to setup a Casdoor instance, for which you need to reference the latest official Casdoor setup tutorial. Make sure you can correctly setup the Casdoor instance before proceeding to next step.
-
Get this module by
git
:$ git clone https://github.com/casdoor/odoo-casdoor-oauth.git
or
get the module onOdoo App Store
. -
Go to your Odoo instance
src
folder:If your machine is Linux/UNIX, it should be in:
$ cd $HOME/src
If there is not a
custom
folder, then make one and cd into the folder:$ mkdir custom $ cd custom
-
Place the cloned or downloaded (if you get it from Odoo App Store, you need to unzip the zip file to see the
casdoor_oauth
folder)casdoor_oauth
folder here. -
Make sure you install all the dependencies:
$ cd casdoor_oauth $ pip install -r requirements.txt
-
Go back to the
odoo
folder:$ cd $HOME/src/odoo
and run the following command
$ ./odoo-bin --addons-path=../custom,addons -d rd-demo -u casdoor_oauth
Hint:
-d
means the database you want to use and-u
means the module you want to update. Detailed usage and tutorial should be read here. -
If everything worked out so far, you should go to your running Odoo instance and go to its Apps page by clicking the top-left menu icon, select
Apps
In the search box, cancel the
Apps
filter (becausecasdoor_oauth
is aTool
).Then search for
casdoor_oauth
, it should pop up!Click
install
. -
After the install finished, redo
Step 7
above. -
Now go to the top-left menu and click
Settings
, and you should be able to see theCasdoor OAuth
tab in the left pane.Fill in the
Casdoor Authentication URL
in this format (replace theYOUR.SERVER.URL
with your own Casdoor instance's URL):YOUR.SERVER.URL/login/oauth/authorize
-
Then go to your Casdoor instance, click the
Applications
tab on the top navbar.Select your specified application and find the
Client ID
andClient secret
in the settings page.Below the two fields, there is a field called
Redirect URLs
, make sure you fill it in this format (replace theYOUR.ODOO.INSTANCE.URL
with your Odoo instance's URL):YOUR.ODOO.INSTANCE.URL/auth_oauth/signin
You should copy these two info and go back to the Odoo setting page and paste them into your
Casdoor Client ID
andCasdoor Client Secret
fields, respectively.Then make sure the
Active
checkbox is selected.Remember to click the
Save
button on the top left corner before you leave the page! -
By now everything is good to go! Try log out your current user and on the login page you should be able to see the option
Log in with Casdoor
:Click on it and log into Odoo using Casdoor!