Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS$http:当凭据标志为true时,无法在访问控制允许来源中使用通配符_Http_Angularjs_Cookies_Restful Authentication - Fatal编程技术网

AngularJS$http:当凭据标志为true时,无法在访问控制允许来源中使用通配符

AngularJS$http:当凭据标志为true时,无法在访问控制允许来源中使用通配符,http,angularjs,cookies,restful-authentication,Http,Angularjs,Cookies,Restful Authentication,我已经为我的站点创建了会话管理。站点将使用服务进行身份验证,详细信息将保存在cookie中。我试图从RESTful服务器访问服务,但出现错误。我发现它是因为请求的非身份验证。我希望随请求一起发送我的和凭据:true。但是,当我将此与credentials:true一起使用时,控制台中会出现此错误 Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true. 问题是什么?是的,这是一个CRO问

我已经为我的站点创建了会话管理。站点将使用服务进行身份验证,详细信息将保存在cookie中。我试图从RESTful服务器访问服务,但出现错误。我发现它是因为请求的非身份验证。我希望随请求一起发送我的
和凭据:true
。但是,当我将此
与credentials:true一起使用时,控制台中会出现此错误

 Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true.

问题是什么?

是的,这是一个CRO问题。如果您在站点中使用CRO,请不要在access control allow origin中使用通配符。你需要提到你的投入。一次只能授予一个站点权限。您不能使用两个或多个域名授予访问权限。若要这样做,需要为该域的服务器添加另一种方式。可能有不同的请求url。

听起来像是CORS问题。您的站点和restful服务器之间是否有CORS管理?