Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casdoor/casdoor-rust-example
The example code for Casdoor Rust SDK
https://github.com/casdoor/casdoor-rust-example
auth authn casdoor example oauth oidc rust sdk sso
Last synced: about 16 hours ago
JSON representation
The example code for Casdoor Rust SDK
- Host: GitHub
- URL: https://github.com/casdoor/casdoor-rust-example
- Owner: casdoor
- License: apache-2.0
- Created: 2022-06-29T09:45:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-20T08:44:57.000Z (10 months ago)
- Last Synced: 2024-02-22T12:37:06.811Z (9 months ago)
- Topics: auth, authn, casdoor, example, oauth, oidc, rust, sdk, sso
- Language: Vue
- Homepage: https://github.com/casdoor/casdoor-rust-sdk
- Size: 92.8 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
📦⚡️Casdoor Rust Example
An example of casdoor-rust-sdk
## Architecture
Example contains 2 parts:
| Name | SDK | Language | Source code |
|----------|------------------|------------------|-----------------------------------------------------------------|
| Frontend | casdoor-vue-sdk | Javascript + Vue | https://github.com/casdoor/casdoor-rust-example/tree/master/web |
| Backend | casdoor-rust-sdk | Rust | https://github.com/casdoor/casdoor-rust-example/ |## Installation
Example uses Casdoor to manage members. So you need to create an organization and an application for the example in a Casdoor instance.
### Necessary configuration
#### Get the code
```shell
git clone https://github.com/casdoor/casdoor
git clone https://github.com/casdoor/casdoor-rust-example
```#### Run example
- run casdoor
- configure
- Front end```js
// in ./web/src/config.js
export let serverUrl = `http://localhost:5000/api`; // port where rust(backend) runs
```- Back end(conf.toml):
The below config is for the Casdoor demo site: https://door.casdoor.com/, please change it to your own Casdoor instance.
Note: the `certificate` field is omitted as `<...>` due to limited space. For full config, see: https://github.com/casdoor/casdoor-rust-example/blob/master/conf.toml
```toml
endpoint = "https://door.casdoor.com"
client_id = "294b09fbc17f95daf2fe"
client_secret = "dd8982f7046ccba1bbd7851d5c1ece4e52bf039d"
certificate = """-----BEGIN CERTIFICATE-----MIIE+TCCAuGgAwIBAgIDAeJAMA0GCSqGSIb3DQEBCwUAMDYxHTAbBgNVBAoTFENh <...> -----END CERTIFICATE-----"""
org_name = "casbin"
```- install dependencies
```shell
cd web && yarn install
```- run
```bash
cd web && yarn serve
cargo run
```Now, example runs its front end at port 8080 and runs it's back end at port 5000. You can modify the code and see what will happen.