{"id":23744723,"url":"https://github.com/iammahesh123/spring-security-csrf-demo","last_synced_at":"2026-05-07T08:34:39.303Z","repository":{"id":226726327,"uuid":"768511660","full_name":"iammahesh123/spring-security-CSRF-demo","owner":"iammahesh123","description":"This project demonstrates how to integrate CSRF protection in a Spring Boot application using Spring Security.","archived":false,"fork":false,"pushed_at":"2024-03-09T08:40:29.000Z","size":69,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T12:39:19.692Z","etag":null,"topics":["csrf-protection","java","maven","spring-boot","spring-security"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/iammahesh123.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}},"created_at":"2024-03-07T08:13:47.000Z","updated_at":"2024-04-23T21:14:53.000Z","dependencies_parsed_at":"2024-03-09T09:34:51.221Z","dependency_job_id":"ce10cc99-de83-430d-87ac-a1896ffd3fdb","html_url":"https://github.com/iammahesh123/spring-security-CSRF-demo","commit_stats":null,"previous_names":["iammahesh123/spring-csrf-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammahesh123%2Fspring-security-CSRF-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammahesh123%2Fspring-security-CSRF-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammahesh123%2Fspring-security-CSRF-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammahesh123%2Fspring-security-CSRF-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iammahesh123","download_url":"https://codeload.github.com/iammahesh123/spring-security-CSRF-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239897410,"owners_count":19715204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csrf-protection","java","maven","spring-boot","spring-security"],"created_at":"2024-12-31T12:39:41.856Z","updated_at":"2026-03-07T04:30:18.488Z","avatar_url":"https://github.com/iammahesh123.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Security CSRF Demo\n\nThis project demonstrates how to integrate CSRF protection in a Spring Boot application using Spring Security.\n\n## Overview\n\nCross-Site Request Forgery (CSRF) is a type of attack that tricks the user's browser into performing an unwanted action on a trusted site where the user is authenticated. Spring Security provides built-in support for CSRF protection to mitigate such attacks.\n\nIn this demo, we'll showcase how to configure and use CSRF protection in a Spring Boot application.\n\n## Features\n\n- Integration of Spring Security with CSRF protection\n- Customization of CSRF token handling and behavior\n- Demonstration of how to secure endpoints against CSRF attacks\n\n## Project Structure\n\n- `src/main/java`: Contains the Java source code for the Spring Boot application.\n- `src/main/resources`: Contains configuration files and static resources.\n- `pom.xml`: Maven project configuration file.\n\n## Usage\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/iammahesh123/spring-security-CSRF-demo.git\n```\n2. Navigate to the project directory:\n ```bash\n  cd spring-security-csrf-demo\n ```\n3. Build the project using Maven:\n ```bash\nmvn clean package\n ```\n4. Run the application:\n```bash\nmvn run\n ```\n5. Access the application in your web browser: http://localhost:8080\n6. Try accessing protected endpoints and observe how CSRF protection works.\n## Configuration\n- application.properties: Contains application-specific configurations.\n- SecurityConfig.java: Spring Security configuration class where CSRF protection is enabled and customized.\n## Dependencies\n- Java 8 or higher\n- Spring Boot\n- Spring Security\n## Contributing\nContributions are welcome. Please fork the repository, make your changes, and submit a pull request.\n\n## License\nThis project is licensed under the MIT License. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammahesh123%2Fspring-security-csrf-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiammahesh123%2Fspring-security-csrf-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammahesh123%2Fspring-security-csrf-demo/lists"}