diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java new file mode 100644 index 000000000..c3ce9474a --- /dev/null +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java @@ -0,0 +1,20 @@ +package org.mitre.openid.connect.token; + +import org.springframework.security.core.Authentication; +import org.springframework.security.oauth2.provider.AuthorizationRequest; +import org.springframework.security.oauth2.provider.approval.UserApprovalHandler; + +public class JdbcUserApprovalHandler implements UserApprovalHandler { + + @Override + public boolean isApproved(AuthorizationRequest authorizationRequest, + Authentication userAuthentication) { + + //Check database to see if the user identified by the userAuthentication has stored an approval decision + userAuthentication.getPrincipal(); + + + return false; + } + +} diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml b/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml index 2033d04af..bce5105b8 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml +++ b/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml @@ -55,7 +55,6 @@ token-services-ref="defaultOAuth2ProviderTokenService" token-granter-ref="connectAuthCodeTokenGranter" user-approval-handler-ref="userApprovalHandler" authorization-endpoint-url="/openidconnect/auth" token-endpoint-url="/openidconnect/token" - user-approval-page="redirect:/oauth/confirm_access" > diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml b/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml index 4051cc918..8a1984a68 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml +++ b/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml @@ -23,8 +23,7 @@ - - @@ -32,7 +31,7 @@ - +