Basic custom auth

Ref. to #547