implemented prompt=consent
parent
ce2c90fb30
commit
7292766b51
|
@ -125,6 +125,13 @@ public class TofuUserApprovalHandler implements UserApprovalHandler {
|
||||||
String clientId = authorizationRequest.getClientId();
|
String clientId = authorizationRequest.getClientId();
|
||||||
ClientDetails client = clientDetailsService.loadClientByClientId(clientId);
|
ClientDetails client = clientDetailsService.loadClientByClientId(clientId);
|
||||||
|
|
||||||
|
// find out if we're supposed to prompt the user or not
|
||||||
|
String prompt = authorizationRequest.getAuthorizationParameters().get("prompt");
|
||||||
|
if (!"consent".equals(prompt)) {
|
||||||
|
// if the prompt parameter is set to "consent" then we can't use approved sites or whitelisted sites
|
||||||
|
// otherwise, we need to check them below
|
||||||
|
|
||||||
|
|
||||||
//lookup ApprovedSites by userId and clientId
|
//lookup ApprovedSites by userId and clientId
|
||||||
Collection<ApprovedSite> aps = approvedSiteService.getByClientIdAndUserId(clientId, userId);
|
Collection<ApprovedSite> aps = approvedSiteService.getByClientIdAndUserId(clientId, userId);
|
||||||
for (ApprovedSite ap : aps) {
|
for (ApprovedSite ap : aps) {
|
||||||
|
@ -159,6 +166,7 @@ public class TofuUserApprovalHandler implements UserApprovalHandler {
|
||||||
|
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This must be re-parsed here because SECOAUTH forces us to call things in a strange order
|
// This must be re-parsed here because SECOAUTH forces us to call things in a strange order
|
||||||
boolean approved = Boolean.parseBoolean(authorizationRequest.getApprovalParameters().get("user_oauth_approval"));
|
boolean approved = Boolean.parseBoolean(authorizationRequest.getApprovalParameters().get("user_oauth_approval"));
|
||||||
|
|
Loading…
Reference in New Issue