Browse Source

first commit

tags/V2.2.0
chenjiandong 2 years ago
parent
commit
486ffb5fb2
4 changed files with 15 additions and 1 deletions
  1. +1
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java
  2. +1
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/UserController.java
  3. +1
    -1
      tuoheng_oidc_server/src/main/java/com/tuoheng/until/RegisteredClientUtil.java
  4. +12
    -0
      tuoheng_oidc_server/src/main/resources/templates/login.html

+ 1
- 0
tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java View File

@@ -16,4 +16,5 @@ public class Oauth2Controller {
public String login() {
return "login";
}

}

+ 1
- 0
tuoheng_oidc_server/src/main/java/com/tuoheng/controller/UserController.java View File

@@ -4,6 +4,7 @@ import com.tuoheng.model.param.CreateUserDto;
import com.tuoheng.service.UserSevice;
import com.tuoheng.until.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**

+ 1
- 1
tuoheng_oidc_server/src/main/java/com/tuoheng/until/RegisteredClientUtil.java View File

@@ -36,7 +36,7 @@ public class RegisteredClientUtil {
.scope(OidcScopes.OPENID)
.scope(OidcScopes.PROFILE)
.clientSettings(ClientSettings.builder()
.requireAuthorizationConsent(true)
.requireAuthorizationConsent(false)
.requireProofKey(false)
.build())
.tokenSettings(TokenSettings.builder()

+ 12
- 0
tuoheng_oidc_server/src/main/resources/templates/login.html View File

@@ -76,6 +76,15 @@
color: #FFFFFF;
font-size: 16px;
}
.login__form .form__tips{
margin: 0;
height: 0;
position: relative;
top: -14px;
}
.form__tips.is--error{
color: red
}
</style>
</head>
<body>
@@ -86,6 +95,9 @@
<form th:action="@{/login}" method="post">
<input name="username" placeholder="请输入用户名" type="text"/>
<input name="password" placeholder="请输入密码" type="password"/>
<div class="form__tips is--error" th:if="${param.error}">
Invalid username and password.
</div>
<!-- <input name="code" placeholder="请输入验证码" value="code" /> -->
<button type="submit">登 录</button>
</form>

Loading…
Cancel
Save