adding authentication check in request pipeline.