Polish gh-1106 Device Authorization Grant

This commit is contained in:
Joe Grandja
2023-03-21 05:21:48 -04:00
parent 47ff4ad06e
commit 1354ca4549
38 changed files with 371 additions and 308 deletions

View File

@@ -28,7 +28,7 @@ import org.springframework.security.web.authentication.LoginUrlAuthenticationEnt
* @author Steve Riesenberg
* @since 1.1
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebSecurity
public class SecurityConfig {

View File

@@ -18,9 +18,7 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.boot:spring-boot-starter-jdbc"
implementation project(":spring-security-oauth2-authorization-server")
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework:spring-webflux"
implementation "org.webjars:webjars-locator-core"
implementation "org.webjars:bootstrap:3.4.1"
implementation "org.webjars:jquery:3.4.1"

View File

@@ -56,7 +56,7 @@ import org.springframework.security.web.authentication.LoginUrlAuthenticationEnt
* @author Steve Riesenberg
* @since 1.1
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebSecurity
public class SecurityConfig {
@@ -100,7 +100,7 @@ public class SecurityConfig {
public UserDetailsService userDetailsService() {
// @formatter:off
UserDetails userDetails = User.withDefaultPasswordEncoder()
.username("user")
.username("user1")
.password("password")
.roles("USER")
.build();
@@ -144,7 +144,7 @@ public class SecurityConfig {
return new ImmutableJWKSet<>(jwkSet);
}
private static KeyPair generateRsaKey() {
private static KeyPair generateRsaKey() {
KeyPair keyPair;
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
@@ -167,4 +167,4 @@ public class SecurityConfig {
return AuthorizationServerSettings.builder().build();
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2020-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -12,7 +12,7 @@
<div class="container">
<div class="row">
<div class="col-md-8">
<form th:action="@{/oauth2/device_verification}" method="get">
<form th:action="@{/oauth2/device_verification}" method="post">
<h2>Device Activation</h2>
<p>Enter the activation code to authorize the device.</p>
<p class="gap">Activation Code</p>
@@ -30,4 +30,4 @@
</div>
</div>
</body>
</html>
</html>