@@ -104,7 +104,7 @@ protected void processAction( final PwmRequest pwmRequest )
104
104
pwmRequest .sendRedirect ( nextUrl );
105
105
return ;
106
106
}
107
- final String errorMsg = "oauth consumer reached, but oauth authentication has not yet been initiated. " ;
107
+ final String errorMsg = "oauth consumer reached, but oauth authentication has not yet been initiated" ;
108
108
final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
109
109
pwmRequest .respondWithError ( errorInformation );
110
110
LOGGER .error ( pwmRequest , () -> errorMsg );
@@ -117,9 +117,9 @@ protected void processAction( final PwmRequest pwmRequest )
117
117
final String oauthRequestError = pwmRequest .readParameterAsString ( "error" );
118
118
if ( oauthRequestError != null && !oauthRequestError .isEmpty () )
119
119
{
120
- final String errorMsg = "incoming request from remote oauth server is indicating an error: " + oauthRequestError ;
121
- final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg , "Remote Error: " + oauthRequestError , null );
122
- LOGGER .error ( pwmRequest , () -> errorMsg );
120
+ final String errorMsg = "incoming request from remote oauth server is indicating an error" ;
121
+ final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
122
+ LOGGER .error ( pwmRequest , () -> errorMsg + ": " + oauthRequestError );
123
123
pwmRequest .respondWithError ( errorInformation );
124
124
return ;
125
125
}
@@ -189,10 +189,10 @@ protected void processAction( final PwmRequest pwmRequest )
189
189
}
190
190
catch ( final PwmUnrecoverableException e )
191
191
{
192
- final String errorMsg = "unexpected error redirecting user to oauth page: " + e .toString ();
192
+ final String errorMsg = "unexpected error redirecting user to oauth page" ;
193
+ LOGGER .error ( pwmRequest , () -> errorMsg + ": " + e .getMessage () );
193
194
final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
194
195
setLastError ( pwmRequest , errorInformation );
195
- LOGGER .error ( () -> errorInformation .toDebugStr () );
196
196
}
197
197
}
198
198
@@ -206,10 +206,10 @@ protected void processAction( final PwmRequest pwmRequest )
206
206
}
207
207
catch ( final PwmException e )
208
208
{
209
- final String errorMsg = "unexpected error communicating with oauth server: " + e .toString ();
210
- final ErrorInformation errorInformation = new ErrorInformation ( e .getError (), errorMsg );
209
+ final String errorMsg = "unexpected error communicating with oauth server" ;
210
+ LOGGER .error ( pwmRequest , () -> errorMsg + ": " + e .getMessage () );
211
+ final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
211
212
setLastError ( pwmRequest , errorInformation );
212
- LOGGER .error ( () -> errorInformation .toDebugStr () );
213
213
return ;
214
214
}
215
215
@@ -271,9 +271,9 @@ protected void processAction( final PwmRequest pwmRequest )
271
271
}
272
272
catch ( final PwmOperationalException e )
273
273
{
274
- final String errorMsg = "error while examining incoming oauth code for already authenticated session: " + e . getMessage () ;
274
+ final String errorMsg = "error while examining incoming oauth code for already authenticated session" ;
275
275
final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
276
- LOGGER .error ( pwmRequest , () -> errorMsg );
276
+ LOGGER .error ( pwmRequest , () -> errorMsg + ": " + e . getMessage () );
277
277
pwmRequest .respondWithError ( errorInformation );
278
278
return ;
279
279
}
@@ -297,8 +297,9 @@ protected void processAction( final PwmRequest pwmRequest )
297
297
}
298
298
catch ( final PwmException e )
299
299
{
300
- LOGGER .error ( pwmRequest , () -> "error during OAuth authentication attempt: " + e .getMessage () );
301
- final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , e .getMessage () );
300
+ final String errorMsg = "error during OAuth authentication attempt" ;
301
+ LOGGER .error ( pwmRequest , () -> errorMsg + ": " + e .getMessage () );
302
+ final ErrorInformation errorInformation = new ErrorInformation ( PwmError .ERROR_OAUTH_ERROR , errorMsg );
302
303
pwmRequest .respondWithError ( errorInformation );
303
304
return ;
304
305
}
0 commit comments