I have two separated apps (AngularJS + Express + NodeJS) and a Ruby on Rails API (rails-api).
To keep it simple my client application will not authenticate users but it will need to consume the data from api.
I've used authenticate_with_http_token
method in the rails-api and it works (if you pass in header or query params) but I can't retrieve the token as a security form (from environment variable I think) inside the angularjs app. Yes I can access the env vars from express server, but I can't share this values to be used at angular.
App.run(function($http ...) {
// $http.defaults.headers.common.Authorization = proccess.env.AUTH_TOKEN_API <- I can't do this. But is something like this I need.
$http.defaults.headers.common.Authorization = 'Token token=78db1w26vve20aa36...';
How to keep security in api in this case?