Cross-Domain Ajax Requests WSO2 IS

前端 未结 2 1551
梦如初夏
梦如初夏 2021-01-24 06:46
curl -v -X POST -H \"Authorization: Basic \" -k -d \"grant_type=password&username=&password=&         


        
相关标签:
2条回答
  • 2021-01-24 07:24

    This is the expected behaviour when cross origin resource sharing (CORS) is not enabled on Identity Server. In fact you can enable CORS for Identity Server. Check [1] on how to do it.

    [1] http://hasanthipurnima.blogspot.com/2016/05/applying-cors-filter-to-wso2-identity.html

    0 讨论(0)
  • 2021-01-24 07:24

    I don't think the Token API of IS returns CORS headers. To get this working, you can front Token API of IS by API Manager. By default, APIM returns CORS headers in all REST APIs you create in it.

    In fact, API Manager ships an API (i.e. https://localhost:8243/token) which fronts the token API of IS (i.e. https://localhost:9443/oauth2/token) (note: APIM has certain IS features installed in it). But it does not return CORS headers too. To make it return CORS headers, you should follow that SO link you have mentioned.

    Another simple option is, if you only need CORS headers, you can simply front Token API of IS by another custom services which returns CORS headers in the response.

    0 讨论(0)
提交回复
热议问题