add basic-authentication logic