Added verification for failureUrl and successUrl to prevent redirecting away from the webapp.