theforeman/foreman — pull request #822 by eLobato (2013-07-29 09:54:47+00:00)
Title: API REMOTE_USER authentication

This pull request allows the setting 'authorize_login_delegation_api' to work. Basically if foreman is behind any kind of proxy using Integrated Windows Authentication or Apache and mod_authnz_ldap, CAS, Cosign, WebAuth, mod_auth_sspi, etc.., foreman should trust its authentication through REMOTE_USER on API calls too.

While working on this I noticed there is a major overlap between this file and application_controller, possible next steps include moving Oauth to app/services/sso, and factoring out the authorization/authentication code from application_controller and services/api/authorization.rb into a single authentication/authorization file.