{"id":23689795,"url":"https://github.com/deepakmali-09/spring-security-p01","last_synced_at":"2026-04-12T12:46:32.179Z","repository":{"id":270181554,"uuid":"909375629","full_name":"deepakmali-09/spring-security-p01","owner":"deepakmali-09","description":"This project demonstrates the implementation of basic authentication and authorization using Spring Security. It showcases how to secure RESTful APIs, configure access permissions, and use authentication mechanisms like form login and HTTP Basic authentication.","archived":false,"fork":false,"pushed_at":"2024-12-29T05:16:02.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T06:56:52.491Z","etag":null,"topics":["authentication","authorization","java","maven","postman","restful-api","spring-boot","spring-security","web"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepakmali-09.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-28T14:14:51.000Z","updated_at":"2024-12-29T05:16:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b0b2e00-7784-4f28-a8d1-774061e165de","html_url":"https://github.com/deepakmali-09/spring-security-p01","commit_stats":null,"previous_names":["deepakmali-09/spring-security-p01"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deepakmali-09/spring-security-p01","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepakmali-09%2Fspring-security-p01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepakmali-09%2Fspring-security-p01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepakmali-09%2Fspring-security-p01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepakmali-09%2Fspring-security-p01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepakmali-09","download_url":"https://codeload.github.com/deepakmali-09/spring-security-p01/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepakmali-09%2Fspring-security-p01/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31715492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authorization","java","maven","postman","restful-api","spring-boot","spring-security","web"],"created_at":"2024-12-30T01:39:42.851Z","updated_at":"2026-04-12T12:46:32.172Z","avatar_url":"https://github.com/deepakmali-09.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Security Basic Project\n\n## Description\nThis project demonstrates the implementation of basic authentication and authorization using Spring Security. It showcases how to secure RESTful APIs, configure access permissions, and use authentication mechanisms like form login and HTTP Basic authentication.\n\n## Features\n- **Authentication:** Ensures that only authorized users can access protected endpoints.\n- **Authorization:** Configures public and secured routes with role-based access.\n- **REST API Endpoints:**\n    - Publicly accessible endpoints.\n    - Secured endpoints requiring authentication.\n- **Custom Configuration:** Uses `SecurityFilterChain` to define security configurations.\n\n## Technologies Used\n- **Java**: Programming language used for the backend.\n- **Spring Boot**: Framework for building the application.\n- **Spring Security**: Handles authentication and authorization.\n- **Maven**: Dependency management.\n\n## Project Structure\n```\nsrc/main/java\n├── com.deep.SpringSecurity-p01\n│   ├── config\n│   │   └── WebConfig.java\n│   ├── controller\n│   │   └── MyController.java\n│   └── SpringSecurityP01Application.java\n```\n\n- **WebConfig.java**: Configures security settings, defines public and secured endpoints.\n- **ApiController.java**: Contains REST API endpoints.\n- **SpringSecurityApplication.java**: Main class to bootstrap the application.\n\n## Endpoints\n| Endpoint     | Method | Access         |\n|--------------|--------|----------------|\n| `/updates`   | GET    | Public         |\n| `/contact`   | GET    | Public         |\n| `/secure`    | GET    | Secured (Login Required) |\n\n## Configuration Highlights\n- **Security Configuration**:\n  ```java\n  @Configuration\n  @EnableWebSecurity\n  public class WebConfig {\n\n      @Bean\n      public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception {\n          httpSecurity.authorizeHttpRequests(req -\u003e\n                  req.requestMatchers(\"/contact\", \"updates\").permitAll()\n                     .anyRequest().authenticated()\n          ).formLogin(withDefaults())\n            .httpBasic(withDefaults());\n\n          return httpSecurity.build();\n      }\n  }\n  ```\n\n- Public endpoints (`/contact`, `/updates`) are accessible without authentication.\n- All other endpoints require authentication.\n\n## Setup and Run\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/deepakmali-09/spring-security-p01.git\n   ```\n\n2. **Navigate to the project directory:**\n   ```bash\n   cd spring-security-p01\n   ```\n\n3. **Build the project using Maven:**\n   ```bash\n   mvn clean install\n   ```\n\n4. **Run the application:**\n   ```bash\n   mvn spring-boot:run\n   ```\n\n5. **Access the APIs:**\n    - Open your browser or Postman.\n    - Test public endpoints (e.g., `http://localhost:8080/updates`).\n    - Test secured endpoints (e.g., `http://localhost:8080/secure`) after logging in.\n\n## Future Enhancements\n- Add user roles and role-based access control.\n- Implement JWT-based authentication.\n- Configure database-backed user authentication.\n\n---\nFeel free to fork and contribute to this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepakmali-09%2Fspring-security-p01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepakmali-09%2Fspring-security-p01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepakmali-09%2Fspring-security-p01/lists"}