if i want auth use query or header, how can do this? if server want close connect, any api can do this?