Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Allow setting withCredentials as $http default. #1209

Closed
wants to merge 1 commit into from

Conversation

thughes
Copy link
Contributor

@thughes thughes commented Jul 30, 2012

Closes #1095.

@mhevery
Copy link
Contributor

mhevery commented Sep 5, 2012

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement).

CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

@thughes
Copy link
Contributor Author

thughes commented Sep 11, 2012

Done.

@mhevery
Copy link
Contributor

mhevery commented Sep 12, 2012

merged

@abdulazeezsk
Copy link

Is this commit part of 1.0.3 version? I am using 1.0.3 version but withCredentials is not set by default. I have to set it to true through config object for every $http request. Is there a way i can set it globally? something like $httpProvider?

@abdulazeezsk
Copy link

I tried this way too, still it didn't work,

config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.withCredentials = true;
}]).

@abdulazeezsk
Copy link

I have just checked changelog of 1.0.3 and 1.1.1
This fix is part of 1.1.1

@samaxes
Copy link
Contributor

samaxes commented Mar 6, 2013

Can this also be merged into the v1.0.x branch?

@keeth
Copy link

keeth commented Sep 20, 2013

+1

@debovis
Copy link

debovis commented Nov 25, 2013

Using this along with the settings from:

http://enable-cors.org/server_apache.html and http://stackoverflow.com/questions/8074665/cross-origin-resource-sharing-with-credentials

allowed me to get CORS with credentials working, thanks!

@SebastianBogado
Copy link

Is there a way to set allowCredentials for $resource? I can't find any references for it.

@debovis
Copy link

debovis commented Feb 13, 2014

Here is a good reference:
http://stackoverflow.com/questions/16554270/how-to-configure-angular-resource-ngresource-to-pull-data-from-another-domain

"$resource uses $http under the covers, so set things up with $http and $resource will be ready to go."

I am using this in my .config method:

$httpProvider.defaults.withCredentials = true;

@NicoleY77
Copy link

+1 it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Ability to pass withCredentials with $resource
8 participants