Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto signin #5

Closed
hailiang-wang opened this issue Nov 7, 2014 · 4 comments
Closed

auto signin #5

hailiang-wang opened this issue Nov 7, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@hailiang-wang
Copy link
Member Author

services.js:188
2XMLHttpRequest cannot load http://mobay.mybluemix.net/auth/local. 
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when 
the credentials flag is true. Origin 'http://192.168.1.103:8100' is therefore not allowed access. 

@hailiang-wang
Copy link
Member Author

XMLHttpRequest cannot load http://mobay.mybluemix.net/auth/local. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.103:8100' is therefore not allowed access. The response had HTTP status code 404. 

@hailiang-wang
Copy link
Member Author

@hailiang-wang
Copy link
Member Author

Tips:

Support CORS in Server side

add header : Access-Control-Allow-Credentials: true

        # Access-Control-Allow-Origin must not be '*', it does not work along with withCredentials tag in mobile client
    res.setHeader('Access-Control-Allow-Origin', '*.mybluemix.net');
    res.setHeader('Access-Control-Allow-Credentials', 'true');

Set withCredentials

.config(function($stateProvider, $urlRouterProvider, $httpProvider, $sceDelegateProvider) {

  $httpProvider.defaults.withCredentials = true;
...

Start your chrome with such command for development

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security

Unfortunately, Safari and firefox do not support this usage. So, when development with grunt serve, only use chrome to open the web page.

@hailiang-wang hailiang-wang changed the title set-cookie is ignored with angularjs auto signin Nov 8, 2014
hailiang-wang added a commit that referenced this issue Nov 9, 2014
@hailiang-wang hailiang-wang added this to the beta milestone Nov 9, 2014
@hailiang-wang hailiang-wang self-assigned this Nov 9, 2014
@hailiang-wang hailiang-wang reopened this Nov 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant