test flow device_code; consent

pull/4/head
shengzhaoli.shengz 2023-10-18 11:56:25 +08:00
parent 41254e5fef
commit 919b17ba61
2 changed files with 32 additions and 8 deletions

View File

@ -120,6 +120,18 @@ public class AuthorizationConsentController {
OidcScopes.PROFILE, OidcScopes.PROFILE,
"This application will be able to read your profile information." "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( SCOPE_DESCRIPTIONS.put(
"message.read", "message.read",
"This application will be able to read your message." "This application will be able to read your message."
@ -141,6 +153,24 @@ public class AuthorizationConsentController {
this.scope = scope; this.scope = scope;
this.description = SCOPE_DESCRIPTIONS.getOrDefault(scope, DEFAULT_DESCRIPTION); 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);
}
} }
} }

View File

@ -5,12 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>授权确认 - Spring Security&OAuth2.1</title> <title>授权确认 - Spring Security&OAuth2.1</title>
<link rel="stylesheet" href="../static/bootstrap.min.css" th:href="@{/bootstrap.min.css}"/> <link rel="stylesheet" href="../static/bootstrap.min.css" th:href="@{/bootstrap.min.css}"/>
<script>
function cancelConsent() {
document.consent_form.reset();
document.consent_form.submit();
}
</script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
@ -84,9 +78,9 @@
</button> </button>
</div> </div>
<div class="pt-3"> <div class="pt-3">
<button class="btn btn-link regular" type="button" id="cancel-consent" onclick="cancelConsent();"> <a class="btn btn-link regular" type="button" id="cancel-consent" onclick="history.back()">
Cancel Cancel
</button> </a>
</div> </div>
</form> </form>
</div> </div>