Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/casdoor/casdoor-spring-security-react-example

Spring Security (via Filter) example app integrated with Casdoor
https://github.com/casdoor/casdoor-spring-security-react-example

auth authentication authn casbin casdoor iam spring spring-security sso

Last synced: 17 days ago
JSON representation

Spring Security (via Filter) example app integrated with Casdoor

Awesome Lists containing this project

README

        

# casdoor-spring-security-react-example

A silent sign-in example is implemented through spring security and casdoor react SDK.

### Installation:

First, you need to clone the repository.

```shell
git clone https://github.com/casdoor/casdoor-spring-security-react-example
```

Then, download the corresponding Maven dependency and front-end dependency respectively.

```shell
# backend
mvn dependency:resolve

# frontend
cd web

yarn install
or
npm install
```

Next, you need to configure two places.

- First, only 7 parameters in `src/main/resources/application.yml` need to be configured.

```yaml
server:
port: 8080
casdoor:
endpoint: http://localhost:8000
client-id:
client-secret:
certificate:
organization-name:
application-name:
redirect-url: /callback
```

- Second, you only need to configure the 6 parameters in `web/src/Setting.js`.

```js
export const ServerUrl = "http://localhost:8080";

const sdkConfig = {
serverUrl: "http://localhost:8000",
clientId: "",
appName: "",
organizationName: "",
redirectPath: "/callback",
};
```

### Start

First, run the `mvn package` command in the project root directory.

Then enter the target directory and execute the `java -jar example-0.0.1-SNAPSHOT.jar` command.

Finally, enter the web directory and execute the command `yarn start`.