An oauth2 demo with angularjs and springboot.
Default username is user
, and password is 111111
.
The project contains 3 modules
- authserver
- ui (A client using oauth2 code flow)
- ui-spa (A client using oauth2 pkce flow, with a standalone frontend module)
- Angular 19
- Gradle Build Tool
- Spring Boot
- Spring security Oauth2 integration
- Thymeleaf server-side Java template engine
Note that ui module and ui-spa module can't be running at the same time, because they use the same port 8080.
git clone https://github.com/qihaiyan/ng-boot-oauth.git
cd ng-boot-oauth
cd authserver
./gradlew bootRun
cd ui
./gradlew bootRun
Now we can visit the app at http://localhost:8080
- RUNNING BACKEND SERVER
cd ui-spa
./gradlew bootRun
If it's the first time to run ui-spa module, install dependencies at first.
cd ui-spa
npm install
- RUNNING DEV SERVER
cd ui-spa
npm run dev
Now we can visit the app at http://localhost:4200