It should be possible to have both basic auth and session auth working at the same time on the REST API.
If a request contains basic auth, the user is authentified this way. If auth fails, the request fails.
If a request doesn't contain basic, we look for a session cookie. We check the session's validity if we find one, and the request fails if the session ain't valid.
If the requests has no basic auth header nor session cookie, we log in the anonymous user if allowed.