@ Override public LtiVerificationResult verifyParameters ( Map < String , String > parameters , String url , String method , String secret ) throws LtiVerificationException { OAuthMessage oam = new OAuthMessage ( method , url , parameters . entrySet ( ) ) ; OAuthConsumer cons = new OAuthConsumer ( null , parameters . get ( OAUTH_KEY_PARAMETER ) , secret , null ) ; OAuthValidator oav = new SimpleOAuthValidator ( ) ; OAuthAccessor acc = new OAuthAccessor ( cons ) ; try { oav . validateMessage ( oam , acc ) ; } catch ( Exception e ) { return new LtiVerificationResult ( false , LtiError . BAD_REQUEST , "Failed to validate: " + e . getLocalizedMessage ( ) + ", Parameters: " + Arrays . toString ( parameters . entrySet ( ) . toArray ( ) ) ) ; } return new LtiVerificationResult ( true , new LtiLaunch ( parameters ) ) ; }
This method will verify a collection of parameters