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

Feature Request: Ability to pass withCredentials with $resource #1095

Closed
bigcmos opened this issue Jun 26, 2012 · 8 comments
Closed

Feature Request: Ability to pass withCredentials with $resource #1095

bigcmos opened this issue Jun 26, 2012 · 8 comments

Comments

@bigcmos
Copy link
Contributor

bigcmos commented Jun 26, 2012

$http now accepts CORS withCredentials, but $resource doesn't make this value available to be set.

Can Haz access to withCredentials or $http.config from $resource?

Without this I am getting a query canceled error in Chrome.

@wesalvaro
Copy link
Contributor

Does setting:

$http.defaults.withCredentials = true;

address this?

@bigcmos
Copy link
Contributor Author

bigcmos commented Jul 17, 2012

No. I tried on v1.0 and looking through the code it doesn't appear to be supported as a default either.

    var module = angular.module('test', ['ngResource']);
    module.config(function($httpProvider) {
      $httpProvider.defaults.withCredentials = true;
    });

@bigcmos
Copy link
Contributor Author

bigcmos commented Jul 31, 2012

This is a work around, but will set all resources to use the default. I would like to use some resources with credentials and some without. Need to expose the http config object or withCredentials from the resource.

@wesalvaro
Copy link
Contributor

Agreed.

@calvinfroedge
Copy link

Would anyone mind providing an example or link to how this is used now?

@calvinfroedge
Copy link

Here is what I am doing currently, but does not seem to be working: http://pastie.org/private/0360dfcyrlfwykoeklmaa

@jroes
Copy link

jroes commented Mar 27, 2013

@calvinfroedge Looks like this hasnt made it into a stable release yet - it's not in 1.0.5.

https://github.com/angular/angular.js/blob/v1.0.x/src/ng/http.js

I'm guessing it's slated for 1.1.x.

@irvins
Copy link

irvins commented May 17, 2013

Im using 1.1.4 and see the withCredentials in the source.
I still cant seem to make a get request via $resource to an API that requires credentials.
is there a flag i have to flip to turn on the default behaviour?

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 a pull request may close this issue.

6 participants