@@ -63,7 +63,7 @@ protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res
6363 , FilterChain fc ) throws ServletException , IOException {
6464
6565 logger .debug ("In OAuthFilter" );
66- logger .debug (req .getMethod ());
66+ logger .debug ("Method Type: " + req .getMethod ());
6767
6868 // Only apply the filter to LTI tool launches (HTTP POSTS)
6969 // Seems like there would be a way to configure the filter to
@@ -75,17 +75,21 @@ protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res
7575 String consumerKey = alphaSortedMap .get (OAuthUtil .CONSUMER_KEY_PARAM );
7676
7777 Tenant tenant = tenantRepository .findByConsumersOauthConsumerKey (consumerKey );
78-
78+ logger . debug ( "consumerKey: " + consumerKey );
7979
8080
8181 if (tenant == null ) {
82+ logger .debug ("tenant was null for consumerKey: " + consumerKey );
8283 res .sendRedirect ("/errorpage" );
8384 return ;
8485 }
8586
87+ logger .debug ("TenantFound: " + tenant .toString ());
88+
8689 Set <Consumer > consumers = tenant .getConsumers ();
8790
8891 if (consumers == null || consumers .isEmpty ()) {
92+ logger .debug ("OAUTH_MISSING_KEY" );
8993 throw new MissingTenantException ("OAUTH_MISSING_KEY" );
9094 }
9195
@@ -101,6 +105,10 @@ protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res
101105 logger .error (e .getMessage (), e );
102106 throw new ServletException ("OAUTH_CALCULATION_ERROR" );
103107 }
108+
109+ logger .debug ("Signature: " + signature );
110+ logger .debug ("Calculated Signature: " + calculatedSignature );
111+
104112
105113 // retry by switch prefix between https and http
106114 if (!signature .equals (calculatedSignature )) {
@@ -122,6 +130,9 @@ protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res
122130 logger .error (e .getMessage (), e );
123131 throw new ServletException ("OAUTH_CALCULATION_ERROR" );
124132 }
133+
134+ logger .debug ("recalculatedSignature Signature: " + recalculatedSignature );
135+
125136 if (!signature .equals (recalculatedSignature )) {
126137 throw new AuthorizationServiceException ("OAUTH_SIGNATURE_MISMATCH" );
127138 }
0 commit comments