From 919b17ba610e411f02dc3df48cc30aee6191fae1 Mon Sep 17 00:00:00 2001 From: "shengzhaoli.shengz" Date: Wed, 18 Oct 2023 11:56:25 +0800 Subject: [PATCH] test flow device_code; consent --- .../AuthorizationConsentController.java | 30 +++++++++++++++++++ src/main/resources/templates/consent.html | 10 ++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/monkeyk/sos/web/controller/AuthorizationConsentController.java b/src/main/java/com/monkeyk/sos/web/controller/AuthorizationConsentController.java index ef01c8f..735e923 100644 --- a/src/main/java/com/monkeyk/sos/web/controller/AuthorizationConsentController.java +++ b/src/main/java/com/monkeyk/sos/web/controller/AuthorizationConsentController.java @@ -120,6 +120,18 @@ public class AuthorizationConsentController { OidcScopes.PROFILE, "This application will be able to read your profile information." ); + SCOPE_DESCRIPTIONS.put( + OidcScopes.EMAIL, + "This application will be able to read your email information." + ); + SCOPE_DESCRIPTIONS.put( + OidcScopes.PHONE, + "This application will be able to read your phone information." + ); + SCOPE_DESCRIPTIONS.put( + OidcScopes.ADDRESS, + "This application will be able to read your address information." + ); SCOPE_DESCRIPTIONS.put( "message.read", "This application will be able to read your message." @@ -141,6 +153,24 @@ public class AuthorizationConsentController { this.scope = scope; this.description = SCOPE_DESCRIPTIONS.getOrDefault(scope, DEFAULT_DESCRIPTION); } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScopeWithDescription that = (ScopeWithDescription) o; + return Objects.equals(scope, that.scope) && Objects.equals(description, that.description); + } + + @Override + public int hashCode() { + return Objects.hash(scope, description); + } } } diff --git a/src/main/resources/templates/consent.html b/src/main/resources/templates/consent.html index 107ce67..af56441 100644 --- a/src/main/resources/templates/consent.html +++ b/src/main/resources/templates/consent.html @@ -5,12 +5,6 @@ 授权确认 - Spring Security&OAuth2.1 -
@@ -84,9 +78,9 @@
- +