device authentication routine with uid and auth_key