A secure and role-based internal portal for managing sensitive company tools, built with Java 21 and Spring Boot 3.5. This portal ensures only authorized internal staff can log in and access features, with granular permission control for different admin roles.
- OAuth2 Login with Google Workspace (internal staff only)
- Role-Based Access Control (RBAC) for granular permissions (
VIEW,EDIT,DELETE) - Secure Session Management with Spring Security
- Dashboard UI for internal operations
- Audit Logging for admin actions
- API Protection with Bearer Tokens
- CSRF & XSS Protection enabled by default
secure-internal-admin-portal/
β
βββ src/main/java/com/company/adminportal/
β βββ config/ # Security and OAuth2 configurations
β βββ controller/ # MVC Controllers for UI and APIs
β βββ service/ # Business logic and permission checks
β βββ repository/ # Data access layer
β βββ model/ # Entities and DTOs
β βββ AdminPortalApplication.java
β
βββ src/main/resources/
β βββ templates/ # Thymeleaf HTML pages (dashboard, login, error)
β βββ static/ # CSS, JS, Images
β βββ application.yml # Configurations
β
βββ pom.xml
βββ README.md
- Login β User logs in via Google OAuth2 (restricted to company domain)
- Token Exchange β OAuth2 provider sends authorization code β backend exchanges for ID Token & Access Token
- Domain Validation β Backend validates email domain (e.g.,
@company.com) - RBAC Enforcement β Only allowed roles can access certain endpoints or UI sections
- Audit Logging β Every admin action is logged
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.5 |
| Security | Spring Security, OAuth2 Client |
| View | Thymeleaf, Bootstrap |
| Database | MySQL / PostgreSQL |
| Build Tool | Maven / Gradle |
| Deployment | Docker, Kubernetes (optional) |
git clone https://github.com/your-username/secure-internal-admin-portal.git
cd secure-internal-admin-portalCreate a .env file or set environment variables:
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
APP_BASE_URL=http://localhost:8080
ALLOWED_DOMAIN=company.com./mvnw spring-boot:runAccess the portal at: http://localhost:8080
| Role | Permissions |
|---|---|
ROLE_ADMIN |
View, Edit, Delete, Create |
ROLE_MANAGER |
View, Edit |
ROLE_VIEWER |
View Only |
π Login Page
π Dashboard
./mvnw testThis project is licensed under the MIT License.
β Prevents unauthorized access to sensitive internal tools β Reduces risk of data breaches β Provides an audit trail for compliance
If you want, I can also add code snippets inside the README so that new developers can quickly understand the OAuth2 configuration and role-based access control setup. That would make it even more developer-friendly.

