Angularjs http basic auth with username and password for Pivotal Tracker api

1.6k Views Asked by At

I'm trying to develop an application to get the Pivotal Tracker stories. First of all I need to do basic authentication to get my Pivotal Tracker token.

Using PHP cURL, I'm doing like this,

curl -X GET --user vader:bad_word "https://www.pivotaltracker.com/services/v5/me"

I want this to be done with Angular. I have tried,

$http.defaults.headers.common['Authorization'] = 'Basic ' + login + ':' + password);

but it shows,

Request header field Authorization is not allowed by Access-Control-Allow-Headers.

any suggestions to get done?

Thanks in advance. :)

2

There are 2 best solutions below

1
On BEST ANSWER

Pivotal Tracker have not yet support client side username and password validation method. Currently they are supporting only X-Token method from client side. If we want to do this, we have to use server side scripting only.

check here : validation can only be done with token and not with "username/password"

and generating the token should done in server side.

Each individual Pivotal Tracker login may be associated with a unique API Token value, which serves as a single-factor authentication for API requests. API tokens are allocated and copied from an individual's Profile page after logging into Tracker.

0
On

PivotalTracker obviously do not send down the correct CORS headers maybe? This would need to be in the http response header of the pre-flight HTTP OPTION call.

Access-Control-Expose-Headers: Authorization

You can see these links for more info:

http://www.html5rocks.com/en/tutorials/cors/

http://enable-cors.org/

http://community.pivotaltracker.com/pivotal/topics/cors_stopped_working_on_api_calls_today