我正在使用Stormpath,並且想要將我的API與客戶端代碼分開(Angular ,使用Stormpath的angular-sdk)。這意味着API將位於與客戶端不同的子域中。一旦我做到了這一點,我就犯了錯誤;Stormpath憑證標誌爲tru時,不能在「Access-Control-Allow-Origin」標頭中使用通配符'*'
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true
我解決了這個問題通過添加特定域到我的快遞CORS配置設置Access-Control-Allow-Origin
,但現在的API是不會從瀏覽器命中作出迴應。
所以我有點困惑,我更喜歡API被打開,但仍然使用Stormpath進行身份驗證,但也許這不可能?
看看這個教程:https://stormpath.com/blog/angularjs-spring-boot-tutorial 它使用了Spring所以因人而異,但仍然是有幫助的。 –