├── .idea
├── .gitignore
├── compiler.xml
├── encodings.xml
├── google-java-format.xml
├── jarRepositories.xml
├── jpa-buddy.xml
├── libraries
│ ├── Maven__antlr_antlr_2_7_7.xml
│ ├── Maven__ch_qos_logback_logback_classic_1_2_11.xml
│ ├── Maven__ch_qos_logback_logback_core_1_2_11.xml
│ ├── Maven__com_fasterxml_classmate_1_5_1.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_13_4.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_13_4.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_13_4_2.xml
│ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_13_4.xml
│ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_13_4.xml
│ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_13_4.xml
│ ├── Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml
│ ├── Maven__com_h2database_h2_2_1_214.xml
│ ├── Maven__com_jayway_jsonpath_json_path_2_7_0.xml
│ ├── Maven__com_nimbusds_nimbus_jose_jwt_9_22.xml
│ ├── Maven__com_sun_activation_jakarta_activation_1_2_2.xml
│ ├── Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml
│ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml
│ ├── Maven__com_zaxxer_HikariCP_4_0_3.xml
│ ├── Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml
│ ├── Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml
│ ├── Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml
│ ├── Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml
│ ├── Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml
│ ├── Maven__net_bytebuddy_byte_buddy_1_12_18.xml
│ ├── Maven__net_bytebuddy_byte_buddy_agent_1_12_18.xml
│ ├── Maven__net_minidev_accessors_smart_2_4_8.xml
│ ├── Maven__net_minidev_json_smart_2_4_8.xml
│ ├── Maven__org_apache_logging_log4j_log4j_api_2_17_2.xml
│ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_17_2.xml
│ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_68.xml
│ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_68.xml
│ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_68.xml
│ ├── Maven__org_apiguardian_apiguardian_api_1_1_2.xml
│ ├── Maven__org_aspectj_aspectjweaver_1_9_7.xml
│ ├── Maven__org_assertj_assertj_core_3_22_0.xml
│ ├── Maven__org_glassfish_jaxb_jaxb_runtime_2_3_7.xml
│ ├── Maven__org_glassfish_jaxb_txw2_2_3_7.xml
│ ├── Maven__org_hamcrest_hamcrest_2_2.xml
│ ├── Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml
│ ├── Maven__org_hibernate_hibernate_core_5_6_12_Final.xml
│ ├── Maven__org_jboss_jandex_2_4_2_Final.xml
│ ├── Maven__org_jboss_logging_jboss_logging_3_4_3_Final.xml
│ ├── Maven__org_junit_jupiter_junit_jupiter_5_8_2.xml
│ ├── Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml
│ ├── Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml
│ ├── Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml
│ ├── Maven__org_junit_platform_junit_platform_commons_1_8_2.xml
│ ├── Maven__org_junit_platform_junit_platform_engine_1_8_2.xml
│ ├── Maven__org_mockito_mockito_core_4_5_1.xml
│ ├── Maven__org_mockito_mockito_junit_jupiter_4_5_1.xml
│ ├── Maven__org_objenesis_objenesis_3_2.xml
│ ├── Maven__org_opentest4j_opentest4j_1_2_0.xml
│ ├── Maven__org_ow2_asm_asm_9_1.xml
│ ├── Maven__org_projectlombok_lombok_1_18_24.xml
│ ├── Maven__org_skyscreamer_jsonassert_1_5_1.xml
│ ├── Maven__org_slf4j_jul_to_slf4j_1_7_36.xml
│ ├── Maven__org_slf4j_slf4j_api_1_7_36.xml
│ ├── Maven__org_springframework_boot_spring_boot_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_configuration_processor_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_devtools_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_aop_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_oauth2_resource_server_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_security_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_test_2_7_5.xml
│ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_7_5.xml
│ ├── Maven__org_springframework_data_spring_data_commons_2_7_5.xml
│ ├── Maven__org_springframework_data_spring_data_jpa_2_7_5.xml
│ ├── Maven__org_springframework_security_spring_security_config_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_core_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_crypto_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_oauth2_core_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_oauth2_jose_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_oauth2_resource_server_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_test_5_7_4.xml
│ ├── Maven__org_springframework_security_spring_security_web_5_7_4.xml
│ ├── Maven__org_springframework_spring_aop_5_3_23.xml
│ ├── Maven__org_springframework_spring_aspects_5_3_23.xml
│ ├── Maven__org_springframework_spring_beans_5_3_23.xml
│ ├── Maven__org_springframework_spring_context_5_3_23.xml
│ ├── Maven__org_springframework_spring_core_5_3_23.xml
│ ├── Maven__org_springframework_spring_expression_5_3_23.xml
│ ├── Maven__org_springframework_spring_jcl_5_3_23.xml
│ ├── Maven__org_springframework_spring_jdbc_5_3_23.xml
│ ├── Maven__org_springframework_spring_orm_5_3_23.xml
│ ├── Maven__org_springframework_spring_test_5_3_23.xml
│ ├── Maven__org_springframework_spring_tx_5_3_23.xml
│ ├── Maven__org_springframework_spring_web_5_3_23.xml
│ ├── Maven__org_springframework_spring_webmvc_5_3_23.xml
│ ├── Maven__org_xmlunit_xmlunit_core_2_9_0.xml
│ └── Maven__org_yaml_snakeyaml_1_30.xml
├── misc.xml
├── modules.xml
├── sonarlint
│ └── issuestore
│ │ └── index.pb
├── uiDesigner.xml
└── vcs.xml
├── Spring Security.pptx
├── basic-authentication
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── httpRequests
│ └── UserResource.http
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── basicauthentication
│ │ │ ├── ApplicationStartup.java
│ │ │ ├── BasicAuthenticationApplication.java
│ │ │ ├── api
│ │ │ ├── LoginRequest.java
│ │ │ └── UserResource.java
│ │ │ ├── configs
│ │ │ ├── CustomUserDetailService.java
│ │ │ ├── MyUserDetails.java
│ │ │ ├── SecurityConfiguration.java
│ │ │ └── filter
│ │ │ │ └── CustomFilter.java
│ │ │ └── user
│ │ │ ├── User.java
│ │ │ ├── UserDao.java
│ │ │ ├── UserService.java
│ │ │ ├── UserServiceImpl.java
│ │ │ ├── requests
│ │ │ └── LoginRequestBody.java
│ │ │ └── responses
│ │ │ └── LoginResponse.java
│ └── resources
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── example
│ └── basicauthentication
│ └── BasicAuthenticationApplicationTests.java
├── spring-security-presentation.iml
├── spring-security-with-authority-jwt-crypted
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── httpRequests
│ └── UserResource.http
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── springsecuritywithauthorityjwtcrypted
│ │ │ ├── SpringSecurityWithAuthorityJwtCryptedApplication.java
│ │ │ ├── api
│ │ │ └── UserResource.java
│ │ │ ├── exception
│ │ │ ├── BusinessException.java
│ │ │ └── GlobalExceptionHandler.java
│ │ │ ├── outservices
│ │ │ ├── EmailVerificationService.java
│ │ │ └── EmailVerificationServiceImpl.java
│ │ │ ├── security
│ │ │ ├── Authority.java
│ │ │ ├── JwtUserDetailsConverter.java
│ │ │ ├── SecurityConfiguration.java
│ │ │ ├── crypto
│ │ │ │ ├── AESCryptoService.java
│ │ │ │ ├── CryptoProperties.java
│ │ │ │ └── CryptoService.java
│ │ │ └── token
│ │ │ │ ├── JwtConfiguration.java
│ │ │ │ ├── JwtProperties.java
│ │ │ │ ├── JwtTokenService.java
│ │ │ │ └── TokenService.java
│ │ │ ├── user
│ │ │ ├── RegisterRequest.java
│ │ │ ├── RegisterResponse.java
│ │ │ ├── User.java
│ │ │ ├── UserDao.java
│ │ │ ├── UserService.java
│ │ │ └── UserServiceImpl.java
│ │ │ └── utilities
│ │ │ └── results
│ │ │ ├── DataResult.java
│ │ │ ├── ErrorDataResult.java
│ │ │ ├── ErrorResult.java
│ │ │ ├── Result.java
│ │ │ ├── SuccessDataResult.java
│ │ │ └── SuccessResult.java
│ └── resources
│ │ └── application.yml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── springsecuritywithauthorityjwtcrypted
│ └── SpringSecurityWithAuthorityJwtCryptedApplicationTests.java
├── spring-security-with-authority-jwt-implementation
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── httpRequests
│ └── UserResource.http
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── example
│ │ └── springsecuritywithauthority
│ │ ├── SpringSecurityWithAuthorityJwtImplementationApplication.java
│ │ ├── api
│ │ ├── Request.java
│ │ ├── SwaggerConfig.java
│ │ └── UserResource.java
│ │ ├── exception
│ │ ├── BusinessException.java
│ │ └── GlobalExceptionHandler.java
│ │ ├── outservices
│ │ ├── EmailVerificationService.java
│ │ └── EmailVerificationServiceImpl.java
│ │ ├── security
│ │ ├── Authority.java
│ │ ├── CustomUserDetailsService.java
│ │ ├── JwtUserDetailsConverter.java
│ │ ├── MyUserDetails.java
│ │ ├── SecurityConfiguration.java
│ │ ├── log
│ │ │ └── LoggingFilter.java
│ │ └── token
│ │ │ ├── JwtConfiguration.java
│ │ │ ├── JwtProperties.java
│ │ │ ├── JwtTokenService.java
│ │ │ └── TokenService.java
│ │ ├── user
│ │ ├── RegisterRequest.java
│ │ ├── RegisterResponse.java
│ │ ├── User.java
│ │ ├── UserDao.java
│ │ ├── UserService.java
│ │ └── UserServiceImpl.java
│ │ └── utilities
│ │ └── results
│ │ ├── DataResult.java
│ │ ├── ErrorDataResult.java
│ │ ├── ErrorResult.java
│ │ ├── Result.java
│ │ ├── SuccessDataResult.java
│ │ └── SuccessResult.java
│ └── resources
│ ├── application.yml
│ └── logback.xml
└── spring-security-with-authority
├── .gitignore
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── httpRequests
└── UserResource.http
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── example
│ │ └── springsecuritywithauthority
│ │ ├── SpringSecurityWithAuthorityApplication.java
│ │ ├── api
│ │ └── UserResource.java
│ │ ├── exception
│ │ ├── BusinessException.java
│ │ └── GlobalExceptionHandler.java
│ │ ├── outservices
│ │ ├── EmailVerificationService.java
│ │ └── EmailVerificationServiceImpl.java
│ │ ├── security
│ │ ├── Authority.java
│ │ ├── CustomUserDetailsService.java
│ │ ├── MyUserDetails.java
│ │ ├── SecurityConfiguration.java
│ │ └── filter
│ │ │ └── CustomFilter.java
│ │ ├── user
│ │ ├── RegisterRequest.java
│ │ ├── RegisterResponse.java
│ │ ├── User.java
│ │ ├── UserDao.java
│ │ ├── UserService.java
│ │ └── UserServiceImpl.java
│ │ └── utilities
│ │ └── results
│ │ ├── DataResult.java
│ │ ├── ErrorDataResult.java
│ │ ├── ErrorResult.java
│ │ ├── Result.java
│ │ ├── SuccessDataResult.java
│ │ └── SuccessResult.java
└── resources
│ └── application.properties
└── test
└── java
└── com
└── example
└── springsecuritywithauthority
└── SpringSecurityWithAuthorityApplicationTests.java
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/google-java-format.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.idea/jpa-buddy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__antlr_antlr_2_7_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_11.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_11.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_13_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_13_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_13_4_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_13_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_13_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_13_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_h2database_h2_2_1_214.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_7_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_nimbusds_nimbus_jose_jwt_9_22.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_sun_activation_jakarta_activation_1_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_12_18.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_12_18.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__net_minidev_accessors_smart_2_4_8.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__net_minidev_json_smart_2_4_8.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_17_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_17_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_68.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_68.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_68.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_assertj_assertj_core_3_22_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_hibernate_hibernate_core_5_6_12_Final.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_jboss_jandex_2_4_2_Final.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_3_Final.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_8_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_mockito_mockito_core_4_5_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_4_5_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_ow2_asm_asm_9_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_projectlombok_lombok_1_18_24.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_36.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_36.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_configuration_processor_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_oauth2_resource_server_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_7_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_config_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_core_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_crypto_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_oauth2_core_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_oauth2_jose_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_oauth2_resource_server_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_test_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_web_5_7_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_aop_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_aspects_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_beans_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_context_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_core_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_expression_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_orm_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_test_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_tx_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_web_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_webmvc_5_3_23.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_9_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_yaml_snakeyaml_1_30.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/sonarlint/issuestore/index.pb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hnfaydn/spring-security-presentation/edda90dc0bbb6e16fb4f9e4d073158b350ca6999/.idea/sonarlint/issuestore/index.pb
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Spring Security.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hnfaydn/spring-security-presentation/edda90dc0bbb6e16fb4f9e4d073158b350ca6999/Spring Security.pptx
--------------------------------------------------------------------------------
/basic-authentication/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/basic-authentication/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hnfaydn/spring-security-presentation/edda90dc0bbb6e16fb4f9e4d073158b350ca6999/basic-authentication/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/basic-authentication/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/basic-authentication/httpRequests/UserResource.http:
--------------------------------------------------------------------------------
1 | ### Get basic authentication test
2 | GET localhost:8080/api/user/get
3 | Authorization: Basic testMail test
4 |
5 |
6 | ### Post with authentication
7 | POST localhost:8080/api/user/login
8 | Authorization: Basic test@mail.com test
9 | Content-Type: application/json
10 |
11 | {
12 | "email": "testMail",
13 | "password": "test"
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/basic-authentication/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.7.5
9 |
10 |
11 | com.example
12 | basic-authentication
13 | 0.0.1-SNAPSHOT
14 | basic-authentication
15 | basic-authentication
16 |
17 | 17
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-data-jpa
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-security
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-starter-web
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-devtools
36 | runtime
37 | true
38 |
39 |
40 | com.h2database
41 | h2
42 | runtime
43 |
44 |
45 | org.projectlombok
46 | lombok
47 | true
48 |
49 |
50 | org.springframework.boot
51 | spring-boot-starter-test
52 | test
53 |
54 |
55 | org.springframework.security
56 | spring-security-test
57 | test
58 |
59 |
60 |
61 |
62 |
63 |
64 | org.springframework.boot
65 | spring-boot-maven-plugin
66 |
67 |
68 |
69 | org.projectlombok
70 | lombok
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/ApplicationStartup.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication;
2 |
3 | import com.example.basicauthentication.user.User;
4 | import com.example.basicauthentication.user.UserDao;
5 | import org.springframework.boot.context.event.ApplicationReadyEvent;
6 | import org.springframework.context.ApplicationListener;
7 | import org.springframework.stereotype.Component;
8 |
9 | import java.util.List;
10 |
11 | @Component
12 | public class ApplicationStartup implements ApplicationListener {
13 | private final UserDao userDao;
14 |
15 | public ApplicationStartup(UserDao userDao) {
16 | this.userDao = userDao;
17 | }
18 |
19 | @Override
20 | public void onApplicationEvent(ApplicationReadyEvent event) {
21 | final var user = new User(1, "testFirstname", "testLastname", "test@mail.com", "test");
22 | final var user2 = new User(2, "testFirstname", "testLastname", "testMail", "test");
23 | final var userList = List.of(user, user2);
24 | this.userDao.saveAll(userList);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/BasicAuthenticationApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class BasicAuthenticationApplication {
8 | public static void main(String[] args) {
9 | SpringApplication.run(BasicAuthenticationApplication.class, args);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/api/LoginRequest.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.api;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 | import lombok.NoArgsConstructor;
6 | import lombok.Setter;
7 |
8 | @Getter
9 | @Setter
10 | @NoArgsConstructor
11 | @AllArgsConstructor
12 | public class LoginRequest {
13 | private String email;
14 | private String password;
15 | }
16 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/api/UserResource.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.api;
2 |
3 | import com.example.basicauthentication.user.UserService;
4 | import com.example.basicauthentication.user.requests.LoginRequestBody;
5 | import com.example.basicauthentication.user.responses.LoginResponse;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.web.bind.annotation.*;
8 |
9 | @RestController
10 | @RequestMapping("/api/user")
11 | public class UserResource {
12 |
13 | private final UserService userService;
14 |
15 | public UserResource(UserService userService) {
16 | this.userService = userService;
17 | }
18 |
19 | @PostMapping("/login")
20 | ResponseEntity login(@RequestBody LoginRequest loginRequest) {
21 | final var loginRequestBody = new LoginRequestBody();
22 | loginRequestBody.setEmail(loginRequest.getEmail());
23 | loginRequestBody.setPassword(loginRequest.getPassword());
24 | return this.userService.login(loginRequestBody);
25 | }
26 |
27 | @GetMapping("/get")
28 | String login() {
29 | return "Security work correctly";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/configs/CustomUserDetailService.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.configs;
2 |
3 | import com.example.basicauthentication.user.UserDao;
4 | import org.springframework.security.core.userdetails.UserDetails;
5 | import org.springframework.security.core.userdetails.UserDetailsService;
6 | import org.springframework.security.core.userdetails.UsernameNotFoundException;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.Objects;
10 |
11 | @Service
12 | public class CustomUserDetailService implements UserDetailsService {
13 | private final UserDao userDao;
14 |
15 | public CustomUserDetailService(UserDao userDao) {
16 | this.userDao = userDao;
17 | }
18 |
19 | @Override
20 | public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
21 | com.example.basicauthentication.user.User user = this.userDao.findUserByEmail(email);
22 | if (Objects.isNull(user)) {
23 | throw new UsernameNotFoundException("There is no user with following email adress:" + email);
24 | }
25 | return new MyUserDetails(user);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/configs/MyUserDetails.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.configs;
2 |
3 | import com.example.basicauthentication.user.User;
4 | import org.springframework.security.core.GrantedAuthority;
5 | import org.springframework.security.core.userdetails.UserDetails;
6 |
7 | import java.util.Collection;
8 | import java.util.List;
9 |
10 | public class MyUserDetails implements UserDetails {
11 | private final User user;
12 |
13 | public MyUserDetails(User user) {
14 | this.user = user;
15 | }
16 |
17 | @Override
18 | public Collection extends GrantedAuthority> getAuthorities() {
19 | return List.of();
20 | }
21 |
22 | @Override
23 | public String getPassword() {
24 | return user.getPassword();
25 | }
26 |
27 | @Override
28 | public String getUsername() {
29 | return user.getEmail();
30 | }
31 |
32 | @Override
33 | public boolean isAccountNonExpired() {
34 | return true;
35 | }
36 |
37 | @Override
38 | public boolean isAccountNonLocked() {
39 | return true;
40 | }
41 |
42 | @Override
43 | public boolean isCredentialsNonExpired() {
44 | return true;
45 | }
46 |
47 | @Override
48 | public boolean isEnabled() {
49 | return true;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/configs/SecurityConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.configs;
2 |
3 | import com.example.basicauthentication.configs.filter.CustomFilter;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.security.config.annotation.web.builders.HttpSecurity;
7 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
8 | import org.springframework.security.core.userdetails.UserDetailsService;
9 | import org.springframework.security.crypto.password.NoOpPasswordEncoder;
10 | import org.springframework.security.crypto.password.PasswordEncoder;
11 | import org.springframework.security.web.SecurityFilterChain;
12 | import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
13 |
14 | import static org.springframework.security.config.Customizer.withDefaults;
15 |
16 | @EnableWebSecurity
17 | @Configuration
18 | public class SecurityConfiguration {
19 | @Bean
20 | public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
21 |
22 | return http.httpBasic(withDefaults())
23 | .addFilterBefore(new CustomFilter(), BasicAuthenticationFilter.class)
24 | .csrf()
25 | .disable()
26 | .build();
27 | }
28 |
29 | @Bean
30 | public PasswordEncoder getPasswordEncoder() {
31 | return NoOpPasswordEncoder.getInstance();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/configs/filter/CustomFilter.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.configs.filter;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
5 | import org.springframework.security.web.authentication.www.BasicAuthenticationConverter;
6 | import org.springframework.web.filter.GenericFilterBean;
7 |
8 | import javax.servlet.FilterChain;
9 | import javax.servlet.ServletException;
10 | import javax.servlet.ServletRequest;
11 | import javax.servlet.ServletResponse;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 | import java.io.IOException;
15 |
16 | @Slf4j
17 | public class CustomFilter extends GenericFilterBean {
18 |
19 | private BasicAuthenticationConverter authenticationConverter = new BasicAuthenticationConverter();
20 |
21 | @Override
22 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
23 | throws IOException, ServletException {
24 | HttpServletRequest httpServletRequest = (HttpServletRequest) request;
25 | HttpServletResponse httpServletResponse = (HttpServletResponse) response;
26 |
27 | UsernamePasswordAuthenticationToken authRequest =
28 | this.authenticationConverter.convert(httpServletRequest);
29 | final var name = authRequest.getName();
30 | final var method = httpServletRequest.getMethod();
31 | log.info("Following user:'{}' has sent request with method type of {}", name, method);
32 |
33 | chain.doFilter(request, response);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/User.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user;
2 |
3 | import lombok.*;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Getter
9 | @Setter
10 | @AllArgsConstructor
11 | @NoArgsConstructor
12 | @Table(name = "users")
13 | @Builder
14 | public class User {
15 | @Id
16 | @GeneratedValue(strategy = GenerationType.IDENTITY)
17 | @Column(name = "id")
18 | private int id;
19 |
20 | @Column(name = "firstname")
21 | private String firstname;
22 |
23 | @Column(name = "lastname")
24 | private String lastname;
25 |
26 | @Column(name = "email")
27 | private String email;
28 |
29 | @Column(name = "password")
30 | private String password;
31 | }
32 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/UserDao.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user;
2 |
3 | import org.springframework.data.jpa.repository.JpaRepository;
4 | import org.springframework.stereotype.Repository;
5 |
6 | @Repository
7 | public interface UserDao extends JpaRepository {
8 | User findUserByEmail(String email);
9 | }
10 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/UserService.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user;
2 |
3 | import com.example.basicauthentication.user.requests.LoginRequestBody;
4 | import com.example.basicauthentication.user.responses.LoginResponse;
5 | import org.springframework.http.ResponseEntity;
6 |
7 | public interface UserService {
8 | ResponseEntity login(LoginRequestBody loginRequestBody);
9 | }
10 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/UserServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user;
2 |
3 | import com.example.basicauthentication.user.requests.LoginRequestBody;
4 | import com.example.basicauthentication.user.responses.LoginResponse;
5 | import org.springframework.http.HttpStatus;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.security.core.userdetails.UsernameNotFoundException;
8 | import org.springframework.stereotype.Service;
9 |
10 | import java.util.Optional;
11 |
12 | @Service
13 | public class UserServiceImpl implements UserService {
14 | private final UserDao userDao;
15 |
16 | public UserServiceImpl(UserDao userDao) {
17 | this.userDao = userDao;
18 | }
19 |
20 | @Override
21 | public ResponseEntity login(LoginRequestBody loginRequestBody) {
22 | final var userByEmail = Optional.of(this.userDao.findUserByEmail(loginRequestBody.getEmail()));
23 |
24 | final var user =
25 | userByEmail.orElseThrow(
26 | () -> {
27 | throw new UsernameNotFoundException(
28 | "There is no user with following email: " + loginRequestBody.getEmail());
29 | });
30 |
31 | return new ResponseEntity<>(
32 | new LoginResponse(user.getEmail(), user.getFirstname(), user.getLastname()), HttpStatus.OK);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/requests/LoginRequestBody.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user.requests;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 | import lombok.NoArgsConstructor;
6 | import lombok.Setter;
7 |
8 | @Getter
9 | @Setter
10 | @NoArgsConstructor
11 | @AllArgsConstructor
12 | public class LoginRequestBody {
13 | private String email;
14 | private String password;
15 | }
16 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/java/com/example/basicauthentication/user/responses/LoginResponse.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication.user.responses;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 | import lombok.NoArgsConstructor;
6 | import lombok.Setter;
7 |
8 | @Getter
9 | @Setter
10 | @NoArgsConstructor
11 | @AllArgsConstructor
12 | public class LoginResponse {
13 | private String email;
14 | private String firstname;
15 | private String lastname;
16 | }
17 |
--------------------------------------------------------------------------------
/basic-authentication/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.datasource.url=jdbc:h2:mem:testdb
2 | spring.datasource.driverClassName=org.h2.Driver
3 | spring.datasource.username=sa
4 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
5 |
--------------------------------------------------------------------------------
/basic-authentication/src/test/java/com/example/basicauthentication/BasicAuthenticationApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.basicauthentication;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class BasicAuthenticationApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {}
11 | }
12 |
--------------------------------------------------------------------------------
/spring-security-presentation.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hnfaydn/spring-security-presentation/edda90dc0bbb6e16fb4f9e4d073158b350ca6999/spring-security-with-authority-jwt-crypted/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/httpRequests/UserResource.http:
--------------------------------------------------------------------------------
1 | ### Register
2 | POST localhost:8080/api/user/register
3 | Content-Type: application/json
4 | X-Csrf-Token:
5 |
6 | {
7 | "firstname": "testFirstname",
8 | "lastname": "testLastname",
9 | "email": "testMail2",
10 | "password": "testPassword",
11 | "authority": "user"
12 | }
13 |
14 | ### Admin
15 | GET localhost:8080/api/user/admin-login
16 | Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzb2Z0cG9zLW1vYmlsZS1iYWNrZW5kIiwic3ViIjoidGVzdE1haWwiLCJleHAiOjE2NjkyNDAyMjcsImlhdCI6MTY2OTE1MzgyNywidXNlciI6IkFBQUFBQUFBQUFBQUFBQUFkcitudzZcL3U0V1dNalh2eHZVMjFwUDRjR1BJamFEZmVCa0pvdTZKYlFOTE15TTZNMEV0ejRDQkdnUmFPTzVMaUpnWGVLQ1FZdEQ4XC83dEk4MngxZ0IyVDNqZXY3RDNKdXE5VVRrMlg4V0hrdm5OUksrbkVcL0pGb2lKQ3ZvZEJtbDVQb2doU0JyTzZXKzZzNGRPaWhzbDZGV2JDSkFjN1VjWmlpeFFKWXBmM2Y0VkhBZTJwb0tjTEhRTEVJWjB6dz0ifQ.duqp-yKDOTCxXJ_rt_oZXAP8uj3aSycBr6S8KXecSsQ
17 |
18 | ### User
19 | GET localhost:8080/api/user/user-login
20 | Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzb2Z0cG9zLW1vYmlsZS1iYWNrZW5kIiwic3ViIjoidGVzdE1haWwyIiwiZXhwIjoxNjY5MzgwNzY4LCJpYXQiOjE2NjkyOTQzNjgsInVzZXIiOiJBQUFBQUFBQUFBQUFBQUFBZHIrbnc2XC91NFdXTWpYdnh2VTIxcFA0Y0dQSWphRGZlQmtKb3U2SmJRTkxNeU02TTBFdHo0Q0JHZ1JhT081TGlKZ1hlS0NRWXREOFwvN3RJODJ4MWdCMlQzamV2N0QzSnVxOVVUazJYOFdHa2hrb1piNkhFN1BFYzBZalB3SWdpejQ5NFJseUJ2STdpb3JNQVRlVHh0aTZaTGR6OU5LSzBFQlRtdlRJb3BmeGpmdThIWjFwMG5jNnh0TDZcL1dLWU09In0.dk83AXejL6hwH5DlQ3L3C0XQKCEcP7MhAI3M5YptRUM
21 |
22 |
23 | ### Editor
24 | GET localhost:8080/api/user/editor-login
25 | Authorization: Basic testMail testPassword
26 |
27 |
28 | ### Any-of-authority
29 | GET localhost:8080/api/user/any-of-request-login
30 | Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzb2Z0cG9zLW1vYmlsZS1iYWNrZW5kIiwic3ViIjoidGVzdE1haWwyIiwiZXhwIjoxNjY5MjQwMzA4LCJpYXQiOjE2NjkxNTM5MDgsInVzZXIiOiJBQUFBQUFBQUFBQUFBQUFBZHIrbnc2XC91NFdXTWpYdnh2VTIxcFA0Y0dQSWphRGZlQmtKb3U2SmJRTkxNeU02TTBFdHo0Q0JHZ1JhT081TGlKZ1hlS0NRWXREOFwvN3RJODJ4MWdCMlQzamV2N0QzSnVxOVVUazJYOFdHa2hrb1piNkhFN1BFYzBZalB3SWdpejQ5NFJseUJ2STdpb3JNQVRlVHh0aTZaTGR6OU5LSzBFQlRtdlRJb3BmeGpmdThIWjFwMG5jNnh0TDZcL1dLWU09In0.ZG7jo-pNF0LMurxxCWaNly1JyZpoxvhoMbNNOYUYaBs
31 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.7.5
9 |
10 |
11 | com.example
12 | spring-security-with-authority-jwt-crypted
13 | 0.0.1-SNAPSHOT
14 | spring-security-with-authority-jwt-crypted
15 | spring-security-with-authority-jwt-crypted
16 |
17 | 17
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-data-jpa
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-oauth2-resource-server
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-configuration-processor
31 | true
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-security
36 |
37 |
38 | org.springframework.boot
39 | spring-boot-starter-web
40 |
41 |
42 |
43 | org.springframework.boot
44 | spring-boot-devtools
45 | runtime
46 | true
47 |
48 |
49 | com.h2database
50 | h2
51 | runtime
52 |
53 |
54 | org.projectlombok
55 | lombok
56 | true
57 |
58 |
59 | org.springframework.boot
60 | spring-boot-starter-test
61 | test
62 |
63 |
64 | org.springframework.security
65 | spring-security-test
66 | test
67 |
68 |
69 |
70 |
71 |
72 |
73 | org.springframework.boot
74 | spring-boot-maven-plugin
75 |
76 |
77 |
78 | org.projectlombok
79 | lombok
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/src/main/java/com/example/springsecuritywithauthorityjwtcrypted/SpringSecurityWithAuthorityJwtCryptedApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.springsecuritywithauthorityjwtcrypted;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class SpringSecurityWithAuthorityJwtCryptedApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(SpringSecurityWithAuthorityJwtCryptedApplication.class, args);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/src/main/java/com/example/springsecuritywithauthorityjwtcrypted/api/UserResource.java:
--------------------------------------------------------------------------------
1 | package com.example.springsecuritywithauthorityjwtcrypted.api;
2 |
3 | import com.example.springsecuritywithauthorityjwtcrypted.user.RegisterRequest;
4 | import com.example.springsecuritywithauthorityjwtcrypted.user.RegisterResponse;
5 | import com.example.springsecuritywithauthorityjwtcrypted.user.UserServiceImpl;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.security.access.prepost.PreAuthorize;
8 | import org.springframework.web.bind.annotation.*;
9 |
10 | @RestController
11 | @RequestMapping("/api/user")
12 | public class UserResource {
13 | private final UserServiceImpl userService;
14 |
15 | public UserResource(UserServiceImpl userService) {
16 | this.userService = userService;
17 | }
18 |
19 | @PostMapping("/register")
20 | public ResponseEntity register(@RequestBody RegisterRequest registerRequest) {
21 | return this.userService.register(registerRequest);
22 | }
23 |
24 | @PreAuthorize("hasAuthority('ADMIN')")
25 | @GetMapping("/admin-login")
26 | public ResponseEntity adminLogin() {
27 | return this.userService.adminAuthorityAcceptOnly();
28 | }
29 |
30 | // @Secured("USER")//work with roles
31 | @PreAuthorize("hasAuthority('USER')")
32 | @GetMapping("/user-login")
33 | public ResponseEntity userLogin() {
34 | return this.userService.userAuthorityAcceptOnly();
35 | }
36 |
37 | // @RolesAllowed("EDITOR")//work with roles
38 | @PreAuthorize("hasAuthority('EDITOR')")
39 | @GetMapping("/editor-login")
40 | public ResponseEntity editorLogin() {
41 | return this.userService.editorAuthorityAcceptOnly();
42 | }
43 |
44 | @GetMapping("/any-of-request-login")
45 | public ResponseEntity anyOfAuthorityLogin() {
46 | return this.userService.acceptsAnyAuthority();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/src/main/java/com/example/springsecuritywithauthorityjwtcrypted/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.example.springsecuritywithauthorityjwtcrypted.exception;
2 |
3 | public class BusinessException extends RuntimeException {
4 | public BusinessException(String message) {
5 | super(message);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spring-security-with-authority-jwt-crypted/src/main/java/com/example/springsecuritywithauthorityjwtcrypted/exception/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.example.springsecuritywithauthorityjwtcrypted.exception;
2 |
3 | import com.example.springsecuritywithauthorityjwtcrypted.utilities.results.ErrorDataResult;
4 | import org.springframework.http.HttpStatus;
5 | import org.springframework.web.bind.annotation.ExceptionHandler;
6 | import org.springframework.web.bind.annotation.ResponseStatus;
7 | import org.springframework.web.bind.annotation.RestControllerAdvice;
8 |
9 | @RestControllerAdvice
10 | public class GlobalExceptionHandler {
11 | @ExceptionHandler
12 | @ResponseStatus(code = HttpStatus.BAD_REQUEST)
13 | public ErrorDataResult