├── .gitignore ├── SpringResourceServer ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── test │ │ └── java │ │ │ └── pk │ │ │ └── training │ │ │ └── basit │ │ │ └── SpringResourceServer │ │ │ └── SpringResourceServerApplicationTests.java │ └── main │ │ ├── java │ │ └── pk │ │ │ └── training │ │ │ └── basit │ │ │ ├── SpringResourceServerApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── rest │ │ │ │ └── MessagesController.java │ │ │ ├── service │ │ │ └── JwtService.java │ │ │ ├── configuration │ │ │ └── ResourceServerConfiguration.java │ │ │ └── converter │ │ │ └── jwt │ │ │ └── CustomJwtGrantedAuthoritiesConverter.java │ │ └── resources │ │ └── application.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── SpringAuthorizationServer ├── src │ ├── main │ │ ├── resources │ │ │ ├── i18n │ │ │ │ ├── validation_en_US.properties │ │ │ │ ├── titles_en_US.properties │ │ │ │ ├── errors_en_US.properties │ │ │ │ └── messages_en_US.properties │ │ │ ├── version.properties │ │ │ ├── static │ │ │ │ ├── image │ │ │ │ │ ├── app-logo.jpg │ │ │ │ │ ├── default-scope-icon.png │ │ │ │ │ └── authorization-code-client-name.png │ │ │ │ └── js │ │ │ │ │ └── jquery-util.js │ │ │ ├── templates │ │ │ │ ├── fragments │ │ │ │ │ ├── header.html │ │ │ │ │ ├── footer.html │ │ │ │ │ └── mainLayout.html │ │ │ │ ├── login.html │ │ │ │ ├── consent.html │ │ │ │ └── consent-customized.html │ │ │ ├── database │ │ │ │ └── scripts │ │ │ │ │ ├── test-data.sql │ │ │ │ │ ├── schema-h2.sql │ │ │ │ │ ├── schema-sql-server.sql │ │ │ │ │ └── schema-oauth2-sql-server.sql │ │ │ ├── oauth2-registered-client.properties │ │ │ ├── federated-identity.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── pk │ │ │ └── training │ │ │ └── basit │ │ │ ├── jpa │ │ │ ├── repository │ │ │ │ └── UserPrincipalRepository.java │ │ │ ├── audit │ │ │ │ ├── AuditDeletedDate.java │ │ │ │ ├── AuditorAwareImpl.java │ │ │ │ └── Audit.java │ │ │ └── entity │ │ │ │ ├── UserAuthority.java │ │ │ │ └── UserPrincipal.java │ │ │ ├── configuration │ │ │ ├── token │ │ │ │ ├── OAuth2TokenSettings.java │ │ │ │ └── impl │ │ │ │ │ └── OAuth2TokenSettingsImpl.java │ │ │ ├── registered │ │ │ │ └── client │ │ │ │ │ ├── OAuth2RegisteredClient.java │ │ │ │ │ └── impl │ │ │ │ │ ├── PasswordOAuth2RegisteredClient.java │ │ │ │ │ ├── AbstractOAuth2RegisteredClient.java │ │ │ │ │ ├── ClientCredentialsOAuth2RegisteredClient.java │ │ │ │ │ └── AuthorizationCodeOAuth2RegisteredClient.java │ │ │ ├── JpaAuditingConfiguration.java │ │ │ ├── federated │ │ │ │ └── identity │ │ │ │ │ ├── UserRepositoryOAuth2UserHandler.java │ │ │ │ │ ├── FederatedIdentityAuthenticationSuccessHandler.java │ │ │ │ │ ├── FederatedIdentityIdTokenCustomizer.java │ │ │ │ │ ├── FederatedIdentityAuthenticationEntryPoint.java │ │ │ │ │ └── FederatedIdentityConfigurer.java │ │ │ ├── jose │ │ │ │ ├── Jwks.java │ │ │ │ └── KeyGeneratorUtils.java │ │ │ ├── OAuth2RegisteredClientConfiguration.java │ │ │ └── SecurityConfiguration.java │ │ │ ├── oauth2 │ │ │ ├── customizer │ │ │ │ ├── jwt │ │ │ │ │ ├── JwtCustomizer.java │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── DefaultJwtCustomizerHandler.java │ │ │ │ │ │ ├── JwtCustomizerImpl.java │ │ │ │ │ │ ├── AbstractJwtCustomizerHandler.java │ │ │ │ │ │ ├── UsernamePasswordAuthenticationTokenJwtCustomizerHandler.java │ │ │ │ │ │ └── OAuth2AuthenticationTokenJwtCustomizerHandler.java │ │ │ │ │ └── JwtCustomizerHandler.java │ │ │ │ └── token │ │ │ │ │ └── claims │ │ │ │ │ ├── OAuth2TokenClaimsCustomizer.java │ │ │ │ │ └── impl │ │ │ │ │ └── OAuth2TokenClaimsCustomizerImpl.java │ │ │ └── authentication │ │ │ │ ├── OAuth2EndpointUtils.java │ │ │ │ ├── OAuth2ResourceOwnerPasswordAuthenticationToken.java │ │ │ │ └── OAuth2ResourceOwnerPasswordAuthenticationConverter.java │ │ │ ├── service │ │ │ ├── OAuth2RegisteredClientService.java │ │ │ ├── UserPrincipalService.java │ │ │ └── impl │ │ │ │ ├── OAuth2RegisteredClientServiceImpl.java │ │ │ │ └── UserPrincipalServiceImpl.java │ │ │ ├── SpringAuthorizationServerApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── web │ │ │ │ ├── LoginController.java │ │ │ │ └── AuthorizationConsentController.java │ │ │ ├── jackson2 │ │ │ ├── mixin │ │ │ │ ├── LongMixin.java │ │ │ │ ├── AuditDeletedDateMixin.java │ │ │ │ ├── UserPrincipalMixin.java │ │ │ │ └── UserAuthorityMixin.java │ │ │ └── deserializer │ │ │ │ ├── AuditDeletedDateDeserializer.java │ │ │ │ └── UserPrincipalDeserializer.java │ │ │ └── endpoint │ │ │ └── actuator │ │ │ └── AppInfoContributor.java │ └── test │ │ └── java │ │ └── pk │ │ └── training │ │ └── basit │ │ └── test │ │ └── SpringAuthorizationServerApplicationTests.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── SpringAuthorizationServerClient ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── java │ │ │ └── pk │ │ │ │ └── training │ │ │ │ └── basit │ │ │ │ ├── config │ │ │ │ ├── oauth2 │ │ │ │ │ └── client │ │ │ │ │ │ ├── OAuth2Client.java │ │ │ │ │ │ └── impl │ │ │ │ │ │ ├── AbstractOAuth2Client.java │ │ │ │ │ │ ├── OidcOAuth2Client.java │ │ │ │ │ │ ├── PasswordOAuth2Client.java │ │ │ │ │ │ ├── ClientCredentialsOAuth2Client.java │ │ │ │ │ │ └── AuthorizationCodeOAuth2Client.java │ │ │ │ ├── OAuth2ClientConfiguration.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ └── WebClientConfig.java │ │ │ │ ├── SpringAuthorizationServerClientApplication.java │ │ │ │ ├── ServletInitializer.java │ │ │ │ └── controller │ │ │ │ └── web │ │ │ │ ├── IndexController.java │ │ │ │ ├── LoginController.java │ │ │ │ └── AuthorizationController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ ├── login.html │ │ │ └── index.html │ └── test │ │ └── java │ │ └── pk │ │ └── training │ │ └── basit │ │ └── SpringAuthorizationServerClientApplicationTests.java ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.class -------------------------------------------------------------------------------- /SpringResourceServer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SpringResourceServer' 2 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/i18n/validation_en_US.properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SpringAuthorizationServer' 2 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/version.properties: -------------------------------------------------------------------------------- 1 | release = 2022.12.04 2 | build = 7 3 | -------------------------------------------------------------------------------- /SpringAuthorizationServerClient/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SpringAuthorizationServerClient' 2 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/i18n/titles_en_US.properties: -------------------------------------------------------------------------------- 1 | title.app = MyApp 2 | title.login = Log In 3 | title.consent = Consent 4 | 5 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/i18n/errors_en_US.properties: -------------------------------------------------------------------------------- 1 | error.incorrect.email.password = Incorrect email and/or password. Please try again. 2 | -------------------------------------------------------------------------------- /SpringResourceServer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringResourceServer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /SpringAuthorizationServer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringAuthorizationServer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /SpringAuthorizationServerClient/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringAuthorizationServerClient/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/static/image/app-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringAuthorizationServer/src/main/resources/static/image/app-logo.jpg -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/static/image/default-scope-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringAuthorizationServer/src/main/resources/static/image/default-scope-icon.png -------------------------------------------------------------------------------- /SpringResourceServer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/static/image/authorization-code-client-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Basit-Mahmood/spring-authorization-server-password-grant-type-support/HEAD/SpringAuthorizationServer/src/main/resources/static/image/authorization-code-client-name.png -------------------------------------------------------------------------------- /SpringAuthorizationServer/src/main/resources/templates/fragments/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Wrong username or password
14 | 30 |30 | The application 31 | 32 | wants to access your account 33 | 34 |
35 |The following permissions are requested by the above app.
Please review
39 | these and consent if you approve.
84 |
85 | Your consent to provide access is required.
86 |
If you do not approve, click Cancel, in which case no information will be shared with the app.
87 |
88 |
62 | This will allow 63 | 64 | to: 65 |
66 |89 | Make sure you trust 90 |
91 |