GithubHelp home page GithubHelp logo

casdoor / odoo-casdoor-oauth Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 5.0 839 KB

Casdoor OAuth Plugin for Odoo

Home Page: https://apps.odoo.com/apps/modules/14.0/casdoor_oauth

License: Apache License 2.0

Python 100.00%
odoo casdoor oauth sso

odoo-casdoor-oauth's Introduction

odoo-casdoor-oauth

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

Usage

  1. 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.

  2. 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.

  3. Get this module by git:

    $ git clone https://github.com/casdoor/odoo-casdoor-oauth.git

    or
    get the module on Odoo App Store.

  4. 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
  5. 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.

  6. Make sure you install all the dependencies:

    $ cd casdoor_oauth
    $ pip install -r requirements.txt
  7. 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.

  8. 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

    Apps

    In the search box, cancel the Apps filter (because casdoor_oauth is a Tool).

    Then search for casdoor_oauth, it should pop up!

    search result

    Click install.

  9. After the install finished, redo Step 7 above.

  10. Now go to the top-left menu and click Settings, and you should be able to see the Casdoor OAuth tab in the left pane.

    Settings Screenshot

    Fill in the Casdoor Authentication URL in this format (replace the YOUR.SERVER.URL with your own Casdoor instance's URL):

    YOUR.SERVER.URL/login/oauth/authorize
  11. Then go to your Casdoor instance, click the Applications tab on the top navbar.

    casdoor applications

    Select your specified application and find the Client ID and Client 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 the YOUR.ODOO.INSTANCE.URL with your Odoo instance's URL):

    YOUR.ODOO.INSTANCE.URL/auth_oauth/signin

    id and secret

    You should copy these two info and go back to the Odoo setting page and paste them into your Casdoor Client ID and Casdoor 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!

  12. 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:

    Login Screenshot

    Click on it and log into Odoo using Casdoor!

odoo-casdoor-oauth's People

Contributors

ffyuanda avatar hsluoyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.