Giter Site home page Giter Site logo

teloei / casdoor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from casdoor/casdoor

0.0 0.0 0.0 1.79 MB

A UI-first centralized authentication / Single-Sign-On (SSO) platform based on OAuth 2.0 / OIDC

Home Page: https://casdoor.org

License: Apache License 2.0

Go 41.80% HTML 1.15% JavaScript 56.69% CSS 0.15% Less 0.20%

casdoor's Introduction

Casdoor

Casdoor is a UI-first centralized authentication / Single-Sign-On (SSO) platform based on OAuth 2.0 / OIDC.

Online demo

Casdoor

Casdoor is the authentication server. It serves both the web UI and the login requests from the application users.

Global admin login:

  • Username: admin
  • Password: 123

Web application

Casbin-OA is one of our applications that use Casdoor as authentication.

Architecture

Casdoor contains 2 parts:

Name Description Language Source code
Frontend Web frontend UI for Casdoor Javascript + React https://github.com/casbin/casdoor/tree/master/web
Backend RESTful API backend for Casdoor Golang + Beego + MySQL https://github.com/casbin/casdoor

Installation

  • Get code via go get:

    go get github.com/casbin/casdoor

    or git clone:

    git clone https://github.com/casbin/casdoor

Run through Docker

  • Install Docker and Docker-compose,you see docker and docker-compose

  • vi casdoor/conf/app.conf

  • Modify dataSourceName = root:123@tcp(localhost:3306)/ to dataSourceName = root:123@tcp(db:3306)/

  • Execute the following command

    docker-compose up
  • Open browser:

    http://localhost:8000/

Run (Dev Environment)

  • Run backend (in port 8000):

    go run main.go
  • Run frontend (in the same machine's port 7001):

    cd web
    ## npm
    npm install
    npm run start
    ## yarn
    yarn install
    yarn run start
  • Open browser:

    http://localhost:7001/

Run (Production Environment)

  • build static pages:

    cd web
    ## npm
    npm run build
    ## yarn
    yarn run build
    ## back to casdoor directory
    cd ..
    
  • build and run go code:

    go build
    ./casdoor
    

Now, Casdoor is running on port 8000. You can access Casdoor pages directly in your browser, or you can setup a reverse proxy to hold your domain name, SSL, etc.

Config

  • Setup database (MySQL):

    Casdoor will store its users, nodes and topics informations in a MySQL database named: casdoor, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/casdoor/blob/master/conf/app.conf

    db = mysql
    dataSourceName = root:123@tcp(localhost:3306)/
    dbName = casdoor
  • Setup database (Postgres):

    Since we must choose a database when opening Postgres with xorm, you should prepare a database manually before running Casdoor. Let's assume that you have already prepared a database called casdoor, then you should specify app.conf like this:

    db = postgres
    dataSourceName = "user=postgres password=xxx sslmode=disable dbname="
    dbName = casdoor

    Please notice: You can add Postgres parameters in dataSourceName, but please make sure that dataSourceName ends with dbname=. Or database adapter may crash when you launch Casdoor.

    Casdoor uses XORM to connect to DB, so all DBs supported by XORM can also be used.

  • Github corner

    We added a Github icon in the upper right corner, linking to your Github repository address. You could set ShowGithubCorner to hidden it.

    Configuration (web/src/commo/Conf.js):

    export const ShowGithubCorner = true
    
    export const GithubRepo = "https://github.com/casbin/casdoor" //your github repository

casdoor's People

Contributors

1340908470 avatar casbin-bot avatar ebreak avatar erikqqy avatar github-actions[bot] avatar hsluoyz avatar kuchaguangjie avatar mrguoking avatar oranges-eating avatar sh1luo avatar turbodog03 avatar uran0sh avatar windspiritsr 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.