Support login with JSON (not basic auth), too