{"id":21646592,"url":"https://github.com/skn437/skn-spring-security","last_synced_at":"2026-02-17T20:34:49.523Z","repository":{"id":228078167,"uuid":"773064818","full_name":"skn437/skn-spring-security","owner":"skn437","description":"A Simple Security Configuration Library For Java Reactive Spring Boot","archived":false,"fork":false,"pushed_at":"2024-12-04T12:25:19.000Z","size":159,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-25T16:48:07.289Z","etag":null,"topics":["gradle","java","library","maven","security","spring-boot"],"latest_commit_sha":null,"homepage":"https://javadoc.io/doc/best.skn/skn-spring-security/latest/index.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skn437.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-16T16:42:40.000Z","updated_at":"2024-12-09T19:54:51.000Z","dependencies_parsed_at":"2024-12-04T13:35:48.386Z","dependency_job_id":null,"html_url":"https://github.com/skn437/skn-spring-security","commit_stats":null,"previous_names":["skn437/skn-spring-security"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/skn437/skn-spring-security","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-spring-security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-spring-security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-spring-security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-spring-security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skn437","download_url":"https://codeload.github.com/skn437/skn-spring-security/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-spring-security/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29557379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T20:14:27.083Z","status":"ssl_error","status_checked_at":"2026-02-17T20:14:26.018Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["gradle","java","library","maven","security","spring-boot"],"created_at":"2024-11-25T06:45:46.580Z","updated_at":"2026-02-17T20:34:44.512Z","avatar_url":"https://github.com/skn437.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SKN Reactive Spring Boot Security Configuration Library\n\n\u003cimg width=\"150px\" src=\"https://firebasestorage.googleapis.com/v0/b/skn-ultimate-project-la437.appspot.com/o/GitHub%20Library%2F05-Spring%20Boot-SSS.svg?alt=media\u0026token=e791da76-75dc-488f-b08b-026c80cb6fa3\" alt=\"java\" /\u003e\n\n\u003e Java\n\n[![Maven Central](https://img.shields.io/maven-central/v/best.skn/skn-spring-security)](https://central.sonatype.com/artifact/best.skn/skn-spring-security) [![Javadoc](https://javadoc.io/badge2/best.skn/skn-spring-security/1.5.0/javadoc.svg)](https://javadoc.io/doc/best.skn/skn-spring-security/1.5.0) [![Apache License 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\u0026nbsp;\n\n## **_JavaDocs:_**\n\n### Read the Javadoc for the main Service APIs\n\n- [CsrfService API](https://javadoc.io/doc/best.skn/skn-spring-security/latest/best/skn/security/services/CsrfService.html)\n- [PrincipalService API](https://javadoc.io/doc/best.skn/skn-spring-security/latest/best/skn/security/services/PrincipalService.html)\n- [SessionService API](https://javadoc.io/doc/best.skn/skn-spring-security/latest/best/skn/security/services/SessionService.html)\n\n\u0026nbsp;\n\n## **_Introduction:_**\n\n### This is a simple Java Reactive Spring Boot Library for security configuration\n\n### I made this library so that I can use it in most of my spring boot reactive projects without writing the same codes over and over again\n\n### The main API Classes of this library are `CsrfService`, `PrincipalService` \u0026 `SessionService`, each of which holds a method for GET request\n\n\u0026nbsp;\n\n## **_Details:_**\n\n### **(1) `CsrfService` Class:**\n\n- It needs to be instantiated first\n- It must be used in controller GET requests\n- It has 1 method to get CSRF Token if CSRF is enabled in Spring Security\n- This method throws `Exception` if error occurs getting and showing CSRF token\n\n### **(2) `PrincipalService` Class:**\n\n- It needs to be instantiated first\n- It must be used in controller GET requests\n- It has 1 method to get Principal information i.e. the info of the authenticated users\n- This method throws `Exception` if error occurs getting and showing Principal info\n\n### **(3) `SessionService` Class:**\n\n- It needs to be instantiated first\n- It must be used in controller GET requests\n- It has 1 method to get Web Session information\n- This method throws `Exception` if error occurs getting and showing Web Session info\n\n\u0026nbsp;\n\n## **_Requirements:_**\n\n- 💀 Minimum Java Version: `21`\n- 💀 Minimum Spring Boot Version: `3.3.5`\n- 💀 Spring Web Flux (Reactive Spring Boot)\n- 💀 Spring Security\n- 💀 Spring Session\n- 💀 Spring OAuth2 Client\n\n\u0026nbsp;\n\n## **_Usage:_**\n\n### For `Maven`, inside `dependencies` tag of `pom.xml`, copy the following\n\n\u003e ```xml\n\u003e \u003cdependency\u003e\n\u003e   \u003cgroupId\u003ebest.skn\u003c/groupId\u003e\n\u003e   \u003cartifactId\u003eskn-spring-security\u003c/artifactId\u003e\n\u003e   \u003cversion\u003e1.5.0\u003c/version\u003e\n\u003e \u003c/dependency\u003e\n\u003e ```\n\n### For `Gradle`, inside `dependencies` block of `build.gradle.kts`, copy the following\n\n\u003e ```kotlin-script\n\u003e implementation(\"best.skn:skn-spring-security:1.5.0\")\n\u003e ```\n\n### First create a configuration class\n\n\u003e ```java\n\u003e import best.skn.security.configurations.*;\n\u003e\n\u003e @Configuration\n\u003e @Import(\n\u003e   {\n\u003e     CsrfConfiguration.class,\n\u003e     PrincipalConfiguration.class,\n\u003e     SessionConfiguration.class\n\u003e   }\n\u003e )\n\u003e public class SecurityInfoConfiguration {}\n\u003e ```\n\n### Inside your Java Code, import the package like this for `CsrfService`\n\n\u003e ```java\n\u003e import best.skn.security.services.CsrfService;\n\u003e ```\n\n### Inside your Java Code, import the package like this for `PrincipalService`\n\n\u003e ```java\n\u003e import best.skn.security.services.PrincipalService;\n\u003e ```\n\n### Inside your Java Code, import the package like this for `SessionService`\n\n\u003e ```java\n\u003e import best.skn.security.services.SessionService;\n\u003e ```\n\n### For external configuration in `application.yaml`, follow the instructions below\n\n\u003e #### (1) CORS Configuration: When setting your CORS allowed origins, you have to give a list of String as a parameter in Spring Security, but with this library you can externalize it\n\u003e\n\u003e \u003e ##### (a) First inside your CORS configuration, do this\n\u003e \u003e\n\u003e \u003e ```java\n\u003e \u003e import best.skn.security.properties.CorsSourceProperty;\n\u003e \u003e\n\u003e \u003e @Configuration\n\u003e \u003e @EnableConfigurationProperties(CorsSourceProperty.class)\n\u003e \u003e public class CorsSourceConfiguration() {\n\u003e \u003e\n\u003e \u003e   @Autowired\n\u003e \u003e   private CorsSourceProperty corsSourceProperty;\n\u003e \u003e\n\u003e \u003e   // your configuration here. The class name is arbitary.\n\u003e \u003e }\n\u003e \u003e ```\n\u003e \u003e\n\u003e \u003e ##### (b) In `application.yaml`, do this\n\u003e \u003e\n\u003e \u003e ```yaml\n\u003e \u003e skn:\n\u003e \u003e   security:\n\u003e \u003e     cors:\n\u003e \u003e       origins:\n\u003e \u003e         - http://localhost:3000\n\u003e \u003e         - http://localhost:5000\n\u003e \u003e ```\n\u003e\n\u003e #### (2) Login Configuration: When setting your custom login url, you have to give a String as a parameter in Spring Security, but with this library you can externalize it\n\u003e\n\u003e \u003e ##### (a) First inside your Login configuration, do this\n\u003e \u003e\n\u003e \u003e ```java\n\u003e \u003e import best.skn.security.properties.LoginProperty;\n\u003e \u003e\n\u003e \u003e @Configuration\n\u003e \u003e @EnableConfigurationProperties(LoginProperty.class)\n\u003e \u003e public class LoginConfiguration() {\n\u003e \u003e\n\u003e \u003e   @Autowired\n\u003e \u003e   private LoginProperty loginProperty;\n\u003e \u003e\n\u003e \u003e   // your configuration here. The class name is arbitary.\n\u003e \u003e }\n\u003e \u003e ```\n\u003e \u003e\n\u003e \u003e ##### (b) In `application.yaml`, do like this\n\u003e \u003e\n\u003e \u003e ```yaml\n\u003e \u003e skn:\n\u003e \u003e   security:\n\u003e \u003e     login:\n\u003e \u003e       url: http://localhost:5000/api/auth/login\n\u003e \u003e ```\n\u003e\n\u003e #### (3) OAuth2 Configuration: When setting your custom successful login redirection url for OAuth2, you have to give a String as a parameter in Spring Security, but with this library you can externalize it\n\u003e\n\u003e \u003e ##### (a) First inside your OAuth2 configuration, do this\n\u003e \u003e\n\u003e \u003e ```java\n\u003e \u003e import best.skn.security.properties.OAuth2Property;\n\u003e \u003e\n\u003e \u003e @Configuration\n\u003e \u003e @EnableConfigurationProperties(OAuth2Property.class)\n\u003e \u003e public class OAuth2Configuration() {\n\u003e \u003e\n\u003e \u003e   @Autowired\n\u003e \u003e   private OAuth2Property oAuth2Property;\n\u003e \u003e\n\u003e \u003e   // your configuration here. The class name is arbitary.\n\u003e \u003e }\n\u003e \u003e ```\n\u003e \u003e\n\u003e \u003e ##### (b) In `application.yaml`, do just like this\n\u003e \u003e\n\u003e \u003e ```yaml\n\u003e \u003e skn:\n\u003e \u003e   security:\n\u003e \u003e     oauth2:\n\u003e \u003e       client:\n\u003e \u003e         success:\n\u003e \u003e           redirect: http://localhost:5000/api/auth/status\n\u003e \u003e ```\n\u003e\n\u003e #### (4) Security Configuration: When setting your authenticated exchanges, you have to give a list of String as a parameter in Spring Security, but with this library you can externalize it\n\u003e\n\u003e \u003e ##### (a) First inside your Security configuration, do this\n\u003e \u003e\n\u003e \u003e ```java\n\u003e \u003e import best.skn.security.properties.SecurityProperty;\n\u003e \u003e\n\u003e \u003e @Configuration\n\u003e \u003e @EnableConfigurationProperties(SecurityProperty.class)\n\u003e \u003e public class SecurityConfiguration() {\n\u003e \u003e\n\u003e \u003e   @Autowired\n\u003e \u003e   private SecurityProperty securityProperty;\n\u003e \u003e\n\u003e \u003e   // your configuration here. The class name is arbitary.\n\u003e \u003e }\n\u003e \u003e ```\n\u003e \u003e\n\u003e \u003e ##### (b) In `application.yaml`, you can do this\n\u003e \u003e\n\u003e \u003e ```yaml\n\u003e \u003e skn:\n\u003e \u003e   security:\n\u003e \u003e     authorize:\n\u003e \u003e       exchanges:\n\u003e \u003e         - /\n\u003e \u003e         - /api/mail/**\n\u003e \u003e ```\n\n\u0026nbsp;\n\n## **_Dedicated To:_**\n\n- 👩‍🎨`Prodipta Das Logno` \u0026 🧛‍♀️`Atoshi Sarker Prithula`: The two most special ladies of my life. My best wishes will always be with you two. May you two always be happy.\n- 💯`My Parents`: The greatest treasures of my life ever.\n\n\u0026nbsp;\n\n## **_License:_**\n\nCopyright (C) 2024 SKN Shukhan\n\nLicensed under the Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskn437%2Fskn-spring-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskn437%2Fskn-spring-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskn437%2Fskn-spring-security/lists"}