Re: [Dev] CORS error in public server

2018-08-03 Thread shibsankar
any comments to this please ?

Regards
Shib

On Thu, Aug 2, 2018 at 1:45 PM, shibsankar  wrote:

>
> It works when I whitelist localhost in wso2 api manager XML  and run from
> local.
>
> But when I move the application to a public server and whitelist the
> public IP in wso2 api manager XML , it does not work.
>
> My CORS configuration Is correct as per your link.
>
> Issue is when I move my angular application to public server and whitelist
> the public server IP in wso2 api manager XML it throws error.
>
>
> Please see the earlier screenshot for error message and IP white listing.
>
> Regards
> Shib
>
>
> On Wednesday, August 1, 2018, Rukshan Premathunga 
> wrote:
>
>> Hi Shib,
>>
>> It seems like you have try to do a request to token api. CORS
>> configuration done in the api-manager.xml not added to the token api by
>> default and you have to do some changes to make it work.
>> Please refer following article which explain how to enable cors for token
>> api.
>>
>> [1] https://medium.com/@iloshinikarunarathne/enabling-cors-
>> for-token-apis-in-wso2-apim-d04f7ef5171
>>
>> Thanks and Regards
>>
>> On Wed, Aug 1, 2018 at 9:22 PM, shibsankar  wrote:
>>
>>> any comments on this, please?
>>>
>>> Regards
>>> Shib
>>>
>>>
>>> On Tue, Jul 31, 2018 at 11:31 AM, shibsankar  wrote:
>>>
 any comments on this?

 Regards
 Shib


 On Mon, Jul 30, 2018 at 12:15 PM, shibsankar  wrote:

> Hi
>
> I have deployed my angular application in a  *public server. *
>
> and then *whitelisted  the public server IP* in wso2's
> *api-manager.xml *
>
>
>
> However, when I call  wso2  token API  from my angular application I
> am getting CORS error.
>
> *Please see the CORS error and WSO2 settings in the screenshot
> attached.*
>
> Could you please suggest what is wrong here and how to fix it?
>
> Regards
> Shib
>
>
>
>
>


>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Rukshan Chathuranga.
>> Software Engineer.
>> WSO2, Inc.
>> +94711822074
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS error in public server

2018-08-02 Thread shibsankar
It works when I whitelist localhost in wso2 api manager XML  and run from
local.

But when I move the application to a public server and whitelist the public
IP in wso2 api manager XML , it does not work.

My CORS configuration Is correct as per your link.

Issue is when I move my angular application to public server and whitelist
the public server IP in wso2 api manager XML it throws error.


Please see the earlier screenshot for error message and IP white listing.

Regards
Shib

On Wednesday, August 1, 2018, Rukshan Premathunga  wrote:

> Hi Shib,
>
> It seems like you have try to do a request to token api. CORS
> configuration done in the api-manager.xml not added to the token api by
> default and you have to do some changes to make it work.
> Please refer following article which explain how to enable cors for token
> api.
>
> [1] https://medium.com/@iloshinikarunarathne/enabling-
> cors-for-token-apis-in-wso2-apim-d04f7ef5171
>
> Thanks and Regards
>
> On Wed, Aug 1, 2018 at 9:22 PM, shibsankar  wrote:
>
>> any comments on this, please?
>>
>> Regards
>> Shib
>>
>>
>> On Tue, Jul 31, 2018 at 11:31 AM, shibsankar  wrote:
>>
>>> any comments on this?
>>>
>>> Regards
>>> Shib
>>>
>>>
>>> On Mon, Jul 30, 2018 at 12:15 PM, shibsankar  wrote:
>>>
 Hi

 I have deployed my angular application in a  *public server. *

 and then *whitelisted  the public server IP* in wso2's
 *api-manager.xml *



 However, when I call  wso2  token API  from my angular application I am
 getting CORS error.

 *Please see the CORS error and WSO2 settings in the screenshot
 attached.*

 Could you please suggest what is wrong here and how to fix it?

 Regards
 Shib





>>>
>>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Rukshan Chathuranga.
> Software Engineer.
> WSO2, Inc.
> +94711822074
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS error in public server

2018-08-01 Thread Rukshan Premathunga
Hi Shib,

It seems like you have try to do a request to token api. CORS configuration
done in the api-manager.xml not added to the token api by default and you
have to do some changes to make it work.
Please refer following article which explain how to enable cors for token
api.

[1]
https://medium.com/@iloshinikarunarathne/enabling-cors-for-token-apis-in-wso2-apim-d04f7ef5171

Thanks and Regards

On Wed, Aug 1, 2018 at 9:22 PM, shibsankar  wrote:

> any comments on this, please?
>
> Regards
> Shib
>
>
> On Tue, Jul 31, 2018 at 11:31 AM, shibsankar  wrote:
>
>> any comments on this?
>>
>> Regards
>> Shib
>>
>>
>> On Mon, Jul 30, 2018 at 12:15 PM, shibsankar  wrote:
>>
>>> Hi
>>>
>>> I have deployed my angular application in a  *public server. *
>>>
>>> and then *whitelisted  the public server IP* in wso2's
>>> *api-manager.xml *
>>>
>>>
>>>
>>> However, when I call  wso2  token API  from my angular application I am
>>> getting CORS error.
>>>
>>> *Please see the CORS error and WSO2 settings in the screenshot attached.*
>>>
>>> Could you please suggest what is wrong here and how to fix it?
>>>
>>> Regards
>>> Shib
>>>
>>>
>>>
>>>
>>>
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
+94711822074
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS error in public server

2018-08-01 Thread shibsankar
 any comments on this, please?

Regards
Shib


On Tue, Jul 31, 2018 at 11:31 AM, shibsankar  wrote:

> any comments on this?
>
> Regards
> Shib
>
>
> On Mon, Jul 30, 2018 at 12:15 PM, shibsankar  wrote:
>
>> Hi
>>
>> I have deployed my angular application in a  *public server. *
>>
>> and then *whitelisted  the public server IP* in wso2's *api-manager.xml *
>>
>>
>>
>> However, when I call  wso2  token API  from my angular application I am
>> getting CORS error.
>>
>> *Please see the CORS error and WSO2 settings in the screenshot attached.*
>>
>> Could you please suggest what is wrong here and how to fix it?
>>
>> Regards
>> Shib
>>
>>
>>
>>
>>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS error in public server

2018-07-31 Thread shibsankar
any comments on this?

Regards
Shib


On Mon, Jul 30, 2018 at 12:15 PM, shibsankar  wrote:

> Hi
>
> I have deployed my angular application in a  *public server. *
>
> and then *whitelisted  the public server IP* in wso2's *api-manager.xml *
>
>
>
> However, when I call  wso2  token API  from my angular application I am
> getting CORS error.
>
> *Please see the CORS error and WSO2 settings in the screenshot attached.*
>
> Could you please suggest what is wrong here and how to fix it?
>
> Regards
> Shib
>
>
>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS ERROR in Custom Service API

2018-07-18 Thread Dushani Wellappili
Hi Shib,

Sorry for the late response.

After you type the value 'http://localhost' in 'Access Control Allow
*Origins' *text box, you need to press Enter key to add that value to the
text box.

Could you please try that and see.

Regards,

*Dushani Wellappili*
Software Engineer - WSO2

Email : dusha...@wso2.com
Mobile : +94779367571
Web : https://wso2.com/




On Wed, Jul 18, 2018 at 5:43 PM shibsankar  wrote:

> Any comments to this?
>
> Regards
> Shib
>
> On Mon, Jul 16, 2018 at 1:34 PM, shibsankar  wrote:
>
>> Yes.  I was asking configuring CROSS-ORIGIN resources sharing for a
>> particular API.
>>
>>
>> I checked your link and I  did the configuration for
>> Access-Control-Allow-Origin as value  http://localhost but this value is
>> not saved.
>>
>> Why this value is not saved ?
>>
>> Please find the screenshots attached to before saving and after saving of
>> CORS configuration.
>>
>> Is there anything I'm missing?
>>
>>
>> Regards
>> Shib
>>
>>
>> On Fri, Jul 13, 2018 at 10:18 PM, Dushani Wellappili 
>> wrote:
>>
>>> Those API based CORS configurations are set as properties
>>> in CORSRequestHandler of the particular API. You can see that in your
>>> relevant api.xml file which inside the
>>> synapse-configs/default/api directory.
>>>
>>>
>>> Regards,
>>>
>>> *Dushani Wellappili*
>>> Software Engineer - WSO2
>>>
>>> Email : dusha...@wso2.com
>>> Mobile : +94779367571
>>> Web : https://wso2.com/
>>>
>>>
>>>
>>>
>>> On Fri, Jul 13, 2018 at 10:09 PM Dushani Wellappili 
>>> wrote:
>>>
 Hi Shib,

 If I have understood correctly, you are asking about configuring
 Cross-Origin Resource Sharing for a particular API. Please refer this [1]
 documentation for enabling API based CORS configurations and see whether it
 works for you.


 [1]
 https://docs.wso2.com/display/AM200/Enabling+CORS+for+APIs#EnablingCORSforAPIs-EnablingCORSPerAPI

 Thanks.

 Regards,
 Dushani Wellappili
 Software Engineer - WSO2

 Email : dusha...@wso2.com
 Mobile : +94779367571
 Web : https://wso2.com/



 *Dushani Wellappili*
 Software Engineer - WSO2

 Email : dusha...@wso2.com
 Mobile : +94779367571
 Web : https://wso2.com/




 On Fri, Jul 13, 2018 at 4:46 PM shibsankar  wrote:

> Hi ,
>
> I'm  getting  CORS  ERROR  in  my OrderWorkFlow service API
> invocation.
>
>
> Which  *file / **files*  has the  CORS configuration in WSO2  for   
> *Custom
> Service  **API*  ?
>
>
> *Error :*
>
> Failed to load 
> *http://xx-xx-xxx-xx-xx..xx.xxx.xxx:8280/bsi/custOrderWorkflow/v1/init
> :
> The value of the 'Access-Control-Allow-Origin' header in the response must
> not be the wildcard '*' when the request's credentials mode is 'include'.
> Origin 'http://localhost ' is therefore not allowed
> access. The credentials mode of requests initiated by the XMLHttpRequest 
> is
> controlled by the withCredentials attribute.*
>
> Regards
> Shib
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>

>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS ERROR in Custom Service API

2018-07-18 Thread shibsankar
Any comments to this?

Regards
Shib

On Mon, Jul 16, 2018 at 1:34 PM, shibsankar  wrote:

> Yes.  I was asking configuring CROSS-ORIGIN resources sharing for a
> particular API.
>
>
> I checked your link and I  did the configuration for
> Access-Control-Allow-Origin as value  http://localhost but this value is
> not saved.
>
> Why this value is not saved ?
>
> Please find the screenshots attached to before saving and after saving of
> CORS configuration.
>
> Is there anything I'm missing?
>
>
> Regards
> Shib
>
>
> On Fri, Jul 13, 2018 at 10:18 PM, Dushani Wellappili 
> wrote:
>
>> Those API based CORS configurations are set as properties
>> in CORSRequestHandler of the particular API. You can see that in your
>> relevant api.xml file which inside the synapse-configs/default/api di
>> rectory.
>>
>>
>> Regards,
>>
>> *Dushani Wellappili*
>> Software Engineer - WSO2
>>
>> Email : dusha...@wso2.com
>> Mobile : +94779367571
>> Web : https://wso2.com/
>>
>>
>>
>>
>> On Fri, Jul 13, 2018 at 10:09 PM Dushani Wellappili 
>> wrote:
>>
>>> Hi Shib,
>>>
>>> If I have understood correctly, you are asking about configuring
>>> Cross-Origin Resource Sharing for a particular API. Please refer this [1]
>>> documentation for enabling API based CORS configurations and see whether it
>>> works for you.
>>>
>>>
>>> [1] https://docs.wso2.com/display/AM200/Enabling+CORS+for+APIs#E
>>> nablingCORSforAPIs-EnablingCORSPerAPI
>>>
>>> Thanks.
>>>
>>> Regards,
>>> Dushani Wellappili
>>> Software Engineer - WSO2
>>>
>>> Email : dusha...@wso2.com
>>> Mobile : +94779367571
>>> Web : https://wso2.com/
>>>
>>>
>>>
>>> *Dushani Wellappili*
>>> Software Engineer - WSO2
>>>
>>> Email : dusha...@wso2.com
>>> Mobile : +94779367571
>>> Web : https://wso2.com/
>>>
>>>
>>>
>>>
>>> On Fri, Jul 13, 2018 at 4:46 PM shibsankar  wrote:
>>>
 Hi ,

 I'm  getting  CORS  ERROR  in  my OrderWorkFlow service API  invocation.


 Which  *file / **files*  has the  CORS configuration in WSO2  for   *Custom
 Service  **API*  ?


 *Error :*

 Failed to load 
 *http://xx-xx-xxx-xx-xx..xx.xxx.xxx:8280/bsi/custOrderWorkflow/v1/init
 :
 The value of the 'Access-Control-Allow-Origin' header in the response must
 not be the wildcard '*' when the request's credentials mode is 'include'.
 Origin 'http://localhost ' is therefore not allowed
 access. The credentials mode of requests initiated by the XMLHttpRequest is
 controlled by the withCredentials attribute.*

 Regards
 Shib
 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev

>>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS ERROR in Custom Service API

2018-07-13 Thread Dushani Wellappili
Hi Shib,

If I have understood correctly, you are asking about configuring
Cross-Origin Resource Sharing for a particular API. Please refer this [1]
documentation for enabling API based CORS configurations and see whether it
works for you.


[1]
https://docs.wso2.com/display/AM200/Enabling+CORS+for+APIs#EnablingCORSforAPIs-EnablingCORSPerAPI

Thanks.

Regards,
Dushani Wellappili
Software Engineer - WSO2

Email : dusha...@wso2.com
Mobile : +94779367571
Web : https://wso2.com/



*Dushani Wellappili*
Software Engineer - WSO2

Email : dusha...@wso2.com
Mobile : +94779367571
Web : https://wso2.com/




On Fri, Jul 13, 2018 at 4:46 PM shibsankar  wrote:

> Hi ,
>
> I'm  getting  CORS  ERROR  in  my OrderWorkFlow service API  invocation.
>
>
> Which  *file / **files*  has the  CORS configuration in WSO2  for   *Custom
> Service  **API*  ?
>
>
> *Error :*
>
> Failed to load 
> *http://xx-xx-xxx-xx-xx..xx.xxx.xxx:8280/bsi/custOrderWorkflow/v1/init
> :
> The value of the 'Access-Control-Allow-Origin' header in the response must
> not be the wildcard '*' when the request's credentials mode is 'include'.
> Origin 'http://localhost ' is therefore not allowed
> access. The credentials mode of requests initiated by the XMLHttpRequest is
> controlled by the withCredentials attribute.*
>
> Regards
> Shib
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS ERROR in userinfo API

2018-07-09 Thread Naduni Pamudika
You can add *CORSRequestHandler* inside the  section as below to
the *_UserInfoAPI_.xml* file in
*/repository/deployment/server/synapse-configs/default/api/
*folder.

  
 
 
  

Thanks,
Naduni

On Mon, Jul 9, 2018 at 4:59 PM, Naduni Pamudika  wrote:

> Hi,
>
> You can refer the document [1] for enabling CORS for userinfo API.
>
> [1] https://docs.wso2.com/display/AM210/Include+
> Additional+Headers+in+the+API+Console#IncludeAdditionalHeadersintheA
> PIConsole-EnableCORSForOauthTokenApis
>
> Thanks,
> Naduni
>
> On Mon, Jul 9, 2018 at 4:49 PM, shibsankar  wrote:
>
>> Hi ,
>>
>> I'm  getting  CORS  ERROR  in  * userinfo**  API * invocation.
>>
>>
>> Which * file / **files*  has the  CORS  configuration  in WSO2  for   
>> *userinfo
>> **API *?
>>
>>
>> Error :
>>
>> *Failed to load
>> http://xx-xx-xxx-xx-xx..xx.xxx.com:8280/userinfo
>> :
>> Response to preflight request doesn't pass access control check: No
>> 'Access-Control-Allow-Origin' header is present on the requested resource.
>> Origin 'http://localhost ' is therefore not allowed
>> access.*
>>
>>
>> Regards
>> Shib
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Naduni Pamudika*
> Software Engineer | WSO2
> Mobile: +94 719 143658 <+94%2071%20914%203658>
> [image: http://wso2.com/signature] 
>



-- 
*Naduni Pamudika*
Software Engineer | WSO2
Mobile: +94 719 143658 <+94%2071%20914%203658>
[image: http://wso2.com/signature] 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS ERROR in userinfo API

2018-07-09 Thread Naduni Pamudika
Hi,

You can refer the document [1] for enabling CORS for userinfo API.

[1]
https://docs.wso2.com/display/AM210/Include+Additional+Headers+in+the+API+Console#IncludeAdditionalHeadersintheAPIConsole-EnableCORSForOauthTokenApis

Thanks,
Naduni

On Mon, Jul 9, 2018 at 4:49 PM, shibsankar  wrote:

> Hi ,
>
> I'm  getting  CORS  ERROR  in  * userinfo**  API * invocation.
>
>
> Which * file / **files*  has the  CORS  configuration  in WSO2  for   
> *userinfo
> **API *?
>
>
> Error :
>
> *Failed to load
> http://xx-xx-xxx-xx-xx..xx.xxx.com:8280/userinfo
> :
> Response to preflight request doesn't pass access control check: No
> 'Access-Control-Allow-Origin' header is present on the requested resource.
> Origin 'http://localhost ' is therefore not allowed
> access.*
>
>
> Regards
> Shib
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Naduni Pamudika*
Software Engineer | WSO2
Mobile: +94 719 143658 <+94%2071%20914%203658>
[image: http://wso2.com/signature] 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-26 Thread Ishara Cooray
Yes, you can disable CORS from the attribute in api-manager.xml

If you do so it will disable CORS for all the APIs served by the API Gateway

Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

On Mon, Jun 25, 2018 at 3:16 PM, shibsankar  wrote:

> any comments to this?
>
> *If this is not doable* ,  Can I disable WSO2 CORS? I see an enabled/
> disabled cors configuration in api-managers.xml (*screenshot attached*).
> Does CORS disabled works?
>
>
> Regards
> Shib
>
> On Mon, Jun 25, 2018 at 1:10 PM, shibsankar  wrote:
>
>> Okay.
>>
>> I tried with  setting the 'content-type' header to
>> 'application/x-www-form-urlencoded' and make the call.
>>
>> still  received same error.
>>
>> also  tried  allowing 9443 for this and make this call .
>>
>> still  received same error.
>>
>> *Please see the error message attached.*
>>
>> Regards
>> Shib
>>
>>
>>
>>
>>
>> On Mon, Jun 18, 2018 at 8:36 AM, Prakhash Sivakumar 
>> wrote:
>>
>>>
>>>
>>> On Fri, Jun 15, 2018 at 5:21 PM Farasath Ahamed 
>>> wrote:
>>>


 On Thu, Jun 14, 2018 at 3:32 PM, shibsankar  wrote:

> *grant_type=password.*
>
>
>
> For your convenience, I  am providing the Angular JS relevant code
>
>
> *// from Angular Controller js*
>
> var dataObj="grant_type=password=x=xxx
> xx=openid";
>
>  Service.callTokenAPI(dataObj)
> .then(function onSuccess(response) {
> console.log("Success");
> console.log("result  = " + JSON.stringify(response));
> }, function onFailure(error) {
> console.log("failure");
> });
>
>
>
> *//from Service.js*
>
> var callTokenAPI = function (dataObj) {
> console.log("Call server dataObj =" + angular.toJson(dataObj));
> var secret=clientKey+":"+clientPass;
> var base64Encoded= btoa(secret);
> console.log("base64Encoded="+base64Encoded);
> return $http({
> url: tokenAPI,
> method: 'POST',
> data: dataObj,
> headers: { "Content-Type": "application/json;charset=utf-8"
> ,"Authorization":base64Encoded}
> });
> };
>
>
 Can you try setting the 'content-type' header to
 'application/x-www-form-urlencoded'? (Check [1])

 [1] https://security.stackexchange.com/questions/187311/why-
 cors-preflight-is-not-available-for-post-requests-when-
 content-type-is-appli/187312#187312

>>>
>>> This should work. Also I think the reason for your observation is when
>>> adding CORS related configs in tokenapi.xml and revokeapi.xml files, the
>>> CORS allowing is not getting applied for the inbound and outbound requests
>>> which uses 8280 and 8243 ports, just to confirm can you please try allowing
>>> 9443 for this and make this call ?
>>>


>
> When I  run this I am getting CORS error screenshot shared earlier.
>
> Regards
> Shib
>
>
> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
> wrote:
>
>> Could you please let us know the grant type you are using here. I
>> would like to know whether this is a valid use case.
>>
>> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>>
>>> Yes.  I get  same CORS error with the correct endpoint, which is */*
>>> *token*
>>>
>>> screenshot attached.
>>>
>>> Regards
>>> Shib
>>>
>>> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
>>> wrote:
>>>
 In the console logs, it says */toekn, *which is wrong spellings.

 Do you get the same CORS error with the correct endpoint, which is
 */**token *?

 On Thu, Jun 14, 2018 at 2:26 PM shibsankar 
 wrote:

> I am receiving CORS Error when I call the WSO2 token API  from
> Angular JS application.
>
> How do you fix this?
>
> Regards
> Shib(9831418066)
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


 --
 *Best Regards*

 *Rushmin Fernando*
 *Technical Lead*

 WSO2 Inc.  - Lean . Enterprise . Middleware

 mobile : +94775615183



>>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Farasath Ahamed
 Senior Software Engineer, WSO2 Inc.; http://wso2.com
 Mobile: +94777603866
 

Re: [Dev] CORS Error

2018-06-25 Thread shibsankar
Okay.

I tried with  setting the 'content-type' header to
'application/x-www-form-urlencoded'
and make the call.

still  received same error.

also  tried  allowing 9443 for this and make this call .

still  received same error.

*Please see the error message attached.*

Regards
Shib





On Mon, Jun 18, 2018 at 8:36 AM, Prakhash Sivakumar 
wrote:

>
>
> On Fri, Jun 15, 2018 at 5:21 PM Farasath Ahamed 
> wrote:
>
>>
>>
>> On Thu, Jun 14, 2018 at 3:32 PM, shibsankar  wrote:
>>
>>> *grant_type=password.*
>>>
>>>
>>>
>>> For your convenience, I  am providing the Angular JS relevant code
>>>
>>>
>>> *// from Angular Controller js*
>>>
>>> var dataObj="grant_type=password=x=
>>> x=openid";
>>>
>>>  Service.callTokenAPI(dataObj)
>>> .then(function onSuccess(response) {
>>> console.log("Success");
>>> console.log("result  = " + JSON.stringify(response));
>>> }, function onFailure(error) {
>>> console.log("failure");
>>> });
>>>
>>>
>>>
>>> *//from Service.js*
>>>
>>> var callTokenAPI = function (dataObj) {
>>> console.log("Call server dataObj =" + angular.toJson(dataObj));
>>> var secret=clientKey+":"+clientPass;
>>> var base64Encoded= btoa(secret);
>>> console.log("base64Encoded="+base64Encoded);
>>> return $http({
>>> url: tokenAPI,
>>> method: 'POST',
>>> data: dataObj,
>>> headers: { "Content-Type": "application/json;charset=utf-8"
>>> ,"Authorization":base64Encoded}
>>> });
>>> };
>>>
>>>
>> Can you try setting the 'content-type' header to 
>> 'application/x-www-form-urlencoded'?
>> (Check [1])
>>
>> [1] https://security.stackexchange.com/questions/
>> 187311/why-cors-preflight-is-not-available-for-post-
>> requests-when-content-type-is-appli/187312#187312
>>
>
> This should work. Also I think the reason for your observation is when
> adding CORS related configs in tokenapi.xml and revokeapi.xml files, the
> CORS allowing is not getting applied for the inbound and outbound requests
> which uses 8280 and 8243 ports, just to confirm can you please try allowing
> 9443 for this and make this call ?
>
>>
>>
>>>
>>> When I  run this I am getting CORS error screenshot shared earlier.
>>>
>>> Regards
>>> Shib
>>>
>>>
>>> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
>>> wrote:
>>>
 Could you please let us know the grant type you are using here. I would
 like to know whether this is a valid use case.

 On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:

> Yes.  I get  same CORS error with the correct endpoint, which is */*
> *token*
>
> screenshot attached.
>
> Regards
> Shib
>
> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
> wrote:
>
>> In the console logs, it says */toekn, *which is wrong spellings.
>>
>> Do you get the same CORS error with the correct endpoint, which is
>> */**token *?
>>
>> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>>
>>> I am receiving CORS Error when I call the WSO2 token API  from
>>> Angular JS application.
>>>
>>> How do you fix this?
>>>
>>> Regards
>>> Shib(9831418066)
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
>

 --
 *Best Regards*

 *Rushmin Fernando*
 *Technical Lead*

 WSO2 Inc.  - Lean . Enterprise . Middleware

 mobile : +94775615183



>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Farasath Ahamed
>> Senior Software Engineer, WSO2 Inc.; http://wso2.com
>> Mobile: +94777603866
>> Blog: blog.farazath.com
>> Twitter: @farazath619 
>> 
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> Prakhash Sivakumar
> Senior Software Engineer | WSO2 Inc
> Platform Security Team
> Mobile : +94771510080
> Blog : https://medium.com/@PrakhashS
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-17 Thread Prakhash Sivakumar
On Fri, Jun 15, 2018 at 5:21 PM Farasath Ahamed  wrote:

>
>
> On Thu, Jun 14, 2018 at 3:32 PM, shibsankar  wrote:
>
>> *grant_type=password.*
>>
>>
>>
>> For your convenience, I  am providing the Angular JS relevant code
>>
>>
>> *// from Angular Controller js*
>>
>> var dataObj="
>> grant_type=password=x=x=openid";
>>
>>  Service.callTokenAPI(dataObj)
>> .then(function onSuccess(response) {
>> console.log("Success");
>> console.log("result  = " + JSON.stringify(response));
>> }, function onFailure(error) {
>> console.log("failure");
>> });
>>
>>
>>
>> *//from Service.js*
>>
>> var callTokenAPI = function (dataObj) {
>> console.log("Call server dataObj =" + angular.toJson(dataObj));
>> var secret=clientKey+":"+clientPass;
>> var base64Encoded= btoa(secret);
>> console.log("base64Encoded="+base64Encoded);
>> return $http({
>> url: tokenAPI,
>> method: 'POST',
>> data: dataObj,
>> headers: { "Content-Type": "application/json;charset=utf-8"
>> ,"Authorization":base64Encoded}
>> });
>> };
>>
>>
> Can you try setting the 'content-type' header to
> 'application/x-www-form-urlencoded'? (Check [1])
>
> [1]
> https://security.stackexchange.com/questions/187311/why-cors-preflight-is-not-available-for-post-requests-when-content-type-is-appli/187312#187312
>

This should work. Also I think the reason for your observation is when
adding CORS related configs in tokenapi.xml and revokeapi.xml files, the
CORS allowing is not getting applied for the inbound and outbound requests
which uses 8280 and 8243 ports, just to confirm can you please try allowing
9443 for this and make this call ?

>
>
>>
>> When I  run this I am getting CORS error screenshot shared earlier.
>>
>> Regards
>> Shib
>>
>>
>> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
>> wrote:
>>
>>> Could you please let us know the grant type you are using here. I would
>>> like to know whether this is a valid use case.
>>>
>>> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>>>
 Yes.  I get  same CORS error with the correct endpoint, which is */*
 *token*

 screenshot attached.

 Regards
 Shib

 On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
 wrote:

> In the console logs, it says */toekn, *which is wrong spellings.
>
> Do you get the same CORS error with the correct endpoint, which is 
> */**token
> *?
>
> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>
>> I am receiving CORS Error when I call the WSO2 token API  from
>> Angular JS application.
>>
>> How do you fix this?
>>
>> Regards
>> Shib(9831418066)
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> *Best Regards*
>
> *Rushmin Fernando*
> *Technical Lead*
>
> WSO2 Inc.  - Lean . Enterprise . Middleware
>
> mobile : +94775615183
>
>
>

>>>
>>> --
>>> *Best Regards*
>>>
>>> *Rushmin Fernando*
>>> *Technical Lead*
>>>
>>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>>
>>> mobile : +94775615183
>>>
>>>
>>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Farasath Ahamed
> Senior Software Engineer, WSO2 Inc.; http://wso2.com
> Mobile: +94777603866
> Blog: blog.farazath.com
> Twitter: @farazath619 
> 
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Prakhash Sivakumar
Senior Software Engineer | WSO2 Inc
Platform Security Team
Mobile : +94771510080
Blog : https://medium.com/@PrakhashS
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-15 Thread Farasath Ahamed
On Thu, Jun 14, 2018 at 3:32 PM, shibsankar  wrote:

> *grant_type=password.*
>
>
>
> For your convenience, I  am providing the Angular JS relevant code
>
>
> *// from Angular Controller js*
>
> var dataObj="grant_type=password=x=xxx
> xx=openid";
>
>  Service.callTokenAPI(dataObj)
> .then(function onSuccess(response) {
> console.log("Success");
> console.log("result  = " + JSON.stringify(response));
> }, function onFailure(error) {
> console.log("failure");
> });
>
>
>
> *//from Service.js*
>
> var callTokenAPI = function (dataObj) {
> console.log("Call server dataObj =" + angular.toJson(dataObj));
> var secret=clientKey+":"+clientPass;
> var base64Encoded= btoa(secret);
> console.log("base64Encoded="+base64Encoded);
> return $http({
> url: tokenAPI,
> method: 'POST',
> data: dataObj,
> headers: { "Content-Type": "application/json;charset=utf-8"
> ,"Authorization":base64Encoded}
> });
> };
>
>
Can you try setting the 'content-type' header to
'application/x-www-form-urlencoded'?
(Check [1])

[1]
https://security.stackexchange.com/questions/187311/why-cors-preflight-is-not-available-for-post-requests-when-content-type-is-appli/187312#187312


>
> When I  run this I am getting CORS error screenshot shared earlier.
>
> Regards
> Shib
>
>
> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
> wrote:
>
>> Could you please let us know the grant type you are using here. I would
>> like to know whether this is a valid use case.
>>
>> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>>
>>> Yes.  I get  same CORS error with the correct endpoint, which is */*
>>> *token*
>>>
>>> screenshot attached.
>>>
>>> Regards
>>> Shib
>>>
>>> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
>>> wrote:
>>>
 In the console logs, it says */toekn, *which is wrong spellings.

 Do you get the same CORS error with the correct endpoint, which is 
 */**token
 *?

 On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:

> I am receiving CORS Error when I call the WSO2 token API  from Angular
> JS application.
>
> How do you fix this?
>
> Regards
> Shib(9831418066)
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


 --
 *Best Regards*

 *Rushmin Fernando*
 *Technical Lead*

 WSO2 Inc.  - Lean . Enterprise . Middleware

 mobile : +94775615183



>>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Farasath Ahamed
Senior Software Engineer, WSO2 Inc.; http://wso2.com
Mobile: +94777603866
Blog: blog.farazath.com
Twitter: @farazath619 

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread Bhathiya Jayasekara
You can set the  to your host in
api-manager.xml

Thanks,
Bhathiya

On Thu, Jun 14, 2018 at 5:47 PM shibsankar  wrote:

> No.Its not working yet.
>
> I added  CORS Handler in tokenapi.xml and revokeapi.xml
>
> restarted  server
>
> tested  my application.
>
> Now I am getting a CORS wildcard error  in my application.   Please see
> the application error screenhsot and wso2 cors handler screenshot.
>
> Regards
> Shib
>
>
>
> On Thu, Jun 14, 2018 at 3:55 PM, Bhathiya Jayasekara 
> wrote:
>
>> This should work for you.
>>
>>
>> https://medium.com/@iloshinikarunarathne/enabling-cors-for-token-apis-in-wso2-apim-d04f7ef5171
>>
>> Thanks,
>> Bhathiya
>>
>> On Thu, Jun 14, 2018 at 3:33 PM shibsankar  wrote:
>>
>>> *grant_type=password.*
>>>
>>>
>>>
>>> For your convenience, I  am providing the Angular JS relevant code
>>>
>>>
>>> *// from Angular Controller js*
>>>
>>> var dataObj="
>>> grant_type=password=x=x=openid";
>>>
>>>  Service.callTokenAPI(dataObj)
>>> .then(function onSuccess(response) {
>>> console.log("Success");
>>> console.log("result  = " + JSON.stringify(response));
>>> }, function onFailure(error) {
>>> console.log("failure");
>>> });
>>>
>>>
>>>
>>> *//from Service.js*
>>>
>>> var callTokenAPI = function (dataObj) {
>>> console.log("Call server dataObj =" + angular.toJson(dataObj));
>>> var secret=clientKey+":"+clientPass;
>>> var base64Encoded= btoa(secret);
>>> console.log("base64Encoded="+base64Encoded);
>>> return $http({
>>> url: tokenAPI,
>>> method: 'POST',
>>> data: dataObj,
>>> headers: { "Content-Type": "application/json;charset=utf-8"
>>> ,"Authorization":base64Encoded}
>>> });
>>> };
>>>
>>>
>>> When I  run this I am getting CORS error screenshot shared earlier.
>>>
>>> Regards
>>> Shib
>>>
>>>
>>> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
>>> wrote:
>>>
 Could you please let us know the grant type you are using here. I would
 like to know whether this is a valid use case.

 On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:

> Yes.  I get  same CORS error with the correct endpoint, which is */*
> *token*
>
> screenshot attached.
>
> Regards
> Shib
>
> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
> wrote:
>
>> In the console logs, it says */toekn, *which is wrong spellings.
>>
>> Do you get the same CORS error with the correct endpoint, which is
>> */**token *?
>>
>> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>>
>>> I am receiving CORS Error when I call the WSO2 token API  from
>>> Angular JS application.
>>>
>>> How do you fix this?
>>>
>>> Regards
>>> Shib(9831418066)
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
>

 --
 *Best Regards*

 *Rushmin Fernando*
 *Technical Lead*

 WSO2 Inc.  - Lean . Enterprise . Middleware

 mobile : +94775615183



>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>> --
>> *Bhathiya Jayasekara*
>> *Associate Technical Lead,*
>> *WSO2 inc., http://wso2.com *
>>
>> *Phone: +94715478185*
>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>> *
>> *Twitter: https://twitter.com/bhathiyax *
>> *Blog: http://movingaheadblog.blogspot.com
>> *
>>
>
>

-- 
*Bhathiya Jayasekara*
*Associate Technical Lead,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread shibsankar
No.Its not working yet.

I added  CORS Handler in tokenapi.xml and revokeapi.xml

restarted  server

tested  my application.

Now I am getting a CORS wildcard error  in my application.   Please see the
application error screenhsot and wso2 cors handler screenshot.

Regards
Shib



On Thu, Jun 14, 2018 at 3:55 PM, Bhathiya Jayasekara 
wrote:

> This should work for you.
>
> https://medium.com/@iloshinikarunarathne/enabling-
> cors-for-token-apis-in-wso2-apim-d04f7ef5171
>
> Thanks,
> Bhathiya
>
> On Thu, Jun 14, 2018 at 3:33 PM shibsankar  wrote:
>
>> *grant_type=password.*
>>
>>
>>
>> For your convenience, I  am providing the Angular JS relevant code
>>
>>
>> *// from Angular Controller js*
>>
>> var dataObj="grant_type=password=x=
>> x=openid";
>>
>>  Service.callTokenAPI(dataObj)
>> .then(function onSuccess(response) {
>> console.log("Success");
>> console.log("result  = " + JSON.stringify(response));
>> }, function onFailure(error) {
>> console.log("failure");
>> });
>>
>>
>>
>> *//from Service.js*
>>
>> var callTokenAPI = function (dataObj) {
>> console.log("Call server dataObj =" + angular.toJson(dataObj));
>> var secret=clientKey+":"+clientPass;
>> var base64Encoded= btoa(secret);
>> console.log("base64Encoded="+base64Encoded);
>> return $http({
>> url: tokenAPI,
>> method: 'POST',
>> data: dataObj,
>> headers: { "Content-Type": "application/json;charset=utf-8"
>> ,"Authorization":base64Encoded}
>> });
>> };
>>
>>
>> When I  run this I am getting CORS error screenshot shared earlier.
>>
>> Regards
>> Shib
>>
>>
>> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
>> wrote:
>>
>>> Could you please let us know the grant type you are using here. I would
>>> like to know whether this is a valid use case.
>>>
>>> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>>>
 Yes.  I get  same CORS error with the correct endpoint, which is */*
 *token*

 screenshot attached.

 Regards
 Shib

 On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
 wrote:

> In the console logs, it says */toekn, *which is wrong spellings.
>
> Do you get the same CORS error with the correct endpoint, which is 
> */**token
> *?
>
> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>
>> I am receiving CORS Error when I call the WSO2 token API  from
>> Angular JS application.
>>
>> How do you fix this?
>>
>> Regards
>> Shib(9831418066)
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> *Best Regards*
>
> *Rushmin Fernando*
> *Technical Lead*
>
> WSO2 Inc.  - Lean . Enterprise . Middleware
>
> mobile : +94775615183
>
>
>

>>>
>>> --
>>> *Best Regards*
>>>
>>> *Rushmin Fernando*
>>> *Technical Lead*
>>>
>>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>>
>>> mobile : +94775615183
>>>
>>>
>>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> *Bhathiya Jayasekara*
> *Associate Technical Lead,*
> *WSO2 inc., http://wso2.com *
>
> *Phone: +94715478185*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> *
> *Twitter: https://twitter.com/bhathiyax *
> *Blog: http://movingaheadblog.blogspot.com
> *
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread Bhathiya Jayasekara
This should work for you.

https://medium.com/@iloshinikarunarathne/enabling-cors-for-token-apis-in-wso2-apim-d04f7ef5171

Thanks,
Bhathiya

On Thu, Jun 14, 2018 at 3:33 PM shibsankar  wrote:

> *grant_type=password.*
>
>
>
> For your convenience, I  am providing the Angular JS relevant code
>
>
> *// from Angular Controller js*
>
> var dataObj="
> grant_type=password=x=x=openid";
>
>  Service.callTokenAPI(dataObj)
> .then(function onSuccess(response) {
> console.log("Success");
> console.log("result  = " + JSON.stringify(response));
> }, function onFailure(error) {
> console.log("failure");
> });
>
>
>
> *//from Service.js*
>
> var callTokenAPI = function (dataObj) {
> console.log("Call server dataObj =" + angular.toJson(dataObj));
> var secret=clientKey+":"+clientPass;
> var base64Encoded= btoa(secret);
> console.log("base64Encoded="+base64Encoded);
> return $http({
> url: tokenAPI,
> method: 'POST',
> data: dataObj,
> headers: { "Content-Type": "application/json;charset=utf-8"
> ,"Authorization":base64Encoded}
> });
> };
>
>
> When I  run this I am getting CORS error screenshot shared earlier.
>
> Regards
> Shib
>
>
> On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando 
> wrote:
>
>> Could you please let us know the grant type you are using here. I would
>> like to know whether this is a valid use case.
>>
>> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>>
>>> Yes.  I get  same CORS error with the correct endpoint, which is */*
>>> *token*
>>>
>>> screenshot attached.
>>>
>>> Regards
>>> Shib
>>>
>>> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
>>> wrote:
>>>
 In the console logs, it says */toekn, *which is wrong spellings.

 Do you get the same CORS error with the correct endpoint, which is 
 */**token
 *?

 On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:

> I am receiving CORS Error when I call the WSO2 token API  from Angular
> JS application.
>
> How do you fix this?
>
> Regards
> Shib(9831418066)
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


 --
 *Best Regards*

 *Rushmin Fernando*
 *Technical Lead*

 WSO2 Inc.  - Lean . Enterprise . Middleware

 mobile : +94775615183



>>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
*Bhathiya Jayasekara*
*Associate Technical Lead,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread shibsankar
 *grant_type=password.*



For your convenience, I  am providing the Angular JS relevant code


*// from Angular Controller js*

var dataObj="
grant_type=password=x=x=openid";

 Service.callTokenAPI(dataObj)
.then(function onSuccess(response) {
console.log("Success");
console.log("result  = " + JSON.stringify(response));
}, function onFailure(error) {
console.log("failure");
});



*//from Service.js*

var callTokenAPI = function (dataObj) {
console.log("Call server dataObj =" + angular.toJson(dataObj));
var secret=clientKey+":"+clientPass;
var base64Encoded= btoa(secret);
console.log("base64Encoded="+base64Encoded);
return $http({
url: tokenAPI,
method: 'POST',
data: dataObj,
headers: { "Content-Type": "application/json;charset=utf-8"
,"Authorization":base64Encoded}
});
};


When I  run this I am getting CORS error screenshot shared earlier.

Regards
Shib


On Thu, Jun 14, 2018 at 3:00 PM, Rushmin Fernando  wrote:

> Could you please let us know the grant type you are using here. I would
> like to know whether this is a valid use case.
>
> On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:
>
>> Yes.  I get  same CORS error with the correct endpoint, which is */*
>> *token*
>>
>> screenshot attached.
>>
>> Regards
>> Shib
>>
>> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
>> wrote:
>>
>>> In the console logs, it says */toekn, *which is wrong spellings.
>>>
>>> Do you get the same CORS error with the correct endpoint, which is */**token
>>> *?
>>>
>>> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>>>
 I am receiving CORS Error when I call the WSO2 token API  from Angular
 JS application.

 How do you fix this?

 Regards
 Shib(9831418066)


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev

>>>
>>>
>>> --
>>> *Best Regards*
>>>
>>> *Rushmin Fernando*
>>> *Technical Lead*
>>>
>>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>>
>>> mobile : +94775615183
>>>
>>>
>>>
>>
>
> --
> *Best Regards*
>
> *Rushmin Fernando*
> *Technical Lead*
>
> WSO2 Inc.  - Lean . Enterprise . Middleware
>
> mobile : +94775615183
>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread Rushmin Fernando
Could you please let us know the grant type you are using here. I would
like to know whether this is a valid use case.

On Thu, Jun 14, 2018 at 2:54 PM shibsankar  wrote:

> Yes.  I get  same CORS error with the correct endpoint, which is */*
> *token*
>
> screenshot attached.
>
> Regards
> Shib
>
> On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando 
> wrote:
>
>> In the console logs, it says */toekn, *which is wrong spellings.
>>
>> Do you get the same CORS error with the correct endpoint, which is */**token
>> *?
>>
>> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>>
>>> I am receiving CORS Error when I call the WSO2 token API  from Angular
>>> JS application.
>>>
>>> How do you fix this?
>>>
>>> Regards
>>> Shib(9831418066)
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>> --
>> *Best Regards*
>>
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> mobile : +94775615183
>>
>>
>>
>

-- 
*Best Regards*

*Rushmin Fernando*
*Technical Lead*

WSO2 Inc.  - Lean . Enterprise . Middleware

mobile : +94775615183
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread shibsankar
Yes.  I get  same CORS error with the correct endpoint, which is */**token*

screenshot attached.

Regards
Shib

On Thu, Jun 14, 2018 at 2:42 PM, Rushmin Fernando  wrote:

> In the console logs, it says */toekn, *which is wrong spellings.
>
> Do you get the same CORS error with the correct endpoint, which is */**token
> *?
>
> On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:
>
>> I am receiving CORS Error when I call the WSO2 token API  from Angular JS
>> application.
>>
>> How do you fix this?
>>
>> Regards
>> Shib(9831418066)
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> *Best Regards*
>
> *Rushmin Fernando*
> *Technical Lead*
>
> WSO2 Inc.  - Lean . Enterprise . Middleware
>
> mobile : +94775615183
>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CORS Error

2018-06-14 Thread Rushmin Fernando
In the console logs, it says */toekn, *which is wrong spellings.

Do you get the same CORS error with the correct endpoint, which is */**token
*?

On Thu, Jun 14, 2018 at 2:26 PM shibsankar  wrote:

> I am receiving CORS Error when I call the WSO2 token API  from Angular JS
> application.
>
> How do you fix this?
>
> Regards
> Shib(9831418066)
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
*Best Regards*

*Rushmin Fernando*
*Technical Lead*

WSO2 Inc.  - Lean . Enterprise . Middleware

mobile : +94775615183
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev