當我發送從客戶端請求我接收302碼,並重定向到登錄,但 下一I接收:asp.net網頁API授權302代碼
控制檯日誌:XMLHttpRequest cannot load https://login.microsoftonline.com/........................ No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost:' is therefore not allowed access. Error: Response with status: 0 for URL: null
ApiController:
[Authorize]
public string Get()
{ }
我想返回狀態代碼401或類似的東西。
你沒有權限調用'的https://login.microsoftonline.com/...'從產地'的https://本地主機: 44315' –
是的,我知道但我想回應401或數據給客戶端,不重定向 – wroe12
您需要詳細說明並給出更多代碼 –