Jump to content
Sign in to follow this  
Guest andreif

SecurityException when trying to login

Recommended Posts

Guest andreif

I’m getting this error, when trying to login. Does it mean my credentials are not ok, or there is some other reason? This error message is too unclear.

CityIndex.JsonClient.ApiException —–> CityIndex.JsonClient.ApiException —–> System.Security.SecurityException —–> System.Security.SecurityException: Security error. at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.ClientHttpWebRequest.<>cDisplayClass5.b4(Object sendState) at System.Net.Browser.AsyncHelper.<>cDisplayClass2.b0(Object sendState) —– End of inner exception stack trace —– at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at CityIndex.JsonClient.Client.<>c__DisplayClassf1.<EnqueueRequest>b__e(IAsyncResult ar,RequestHolder requestHolder)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at CityIndex.JsonClient.ApiAsyncResult1.End() at CityIndex.JsonClient.Client.EndRequestTDTO at CIAPI.Rpc.Client.EndLogIn(ApiAsyncResult1 asyncResult)
   at CityIndexNewsWidget.MainPage.<>c__DisplayClass3.<RefreshNews>b__0(ApiAsyncResult1 ar)

Share this post


Link to post
Guest sky.sanders

We have crossdomain files deployed in the appropriate place and Silverlight client is able to interact with the server now.

NOTE: still having issues with HTTPS so make sure your testing URL is HTTP

Share this post


Link to post
Guest mrdavidlaing

Agree that what ever is going on, the exception is not helpful!

Could you post a snippet of code that generates this exception please.

Share this post


Link to post
Guest andreif
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

Share this post


Link to post
Guest mrdavidlaing
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

Which platform are you running in? Is this a Windows app, a Silverlight app or a Phone7 app?

Share this post


Link to post
Guest andreif
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

@mrdavidlaing It’s a Silverlight app. Windows 7 x64 Ultimate. UPD: it seems this problem is Silverlight-specific. WPF version of the same code works ok.

Share this post


Link to post
Guest mrdavidlaing
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

@andreif Try connecting to the http://ciapipreprod.cityindextest9.co.uk/tradingapi rather than https://ciapi…

I’m thinking its got something to do with the fact that we haven’t published a /clientaccesspolicy.xml

Share this post


Link to post
Guest andreif
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

@mrdavidlaing In this way it makes login successfully, but then fails on ListNewsHeadlines (the same exception)

Share this post


Link to post
Guest mrdavidlaing
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

@andreif Have logged https://github.com/cityindex/ciapi.cs/issues/8 andhttps://github.com/cityindex/ciapi.cs/issues/9

Share this post


Link to post
Guest andreif
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

@mrdavidlaing

Share this post


Link to post
Guest sky.sanders
var client = new Client(RPC_URI);
            client.BeginLogIn(USERNAME, PASSWORD,
                ar =>
                {
                    try
                    {
                        client.EndLogIn(ar);
                    }
                    catch (Exception exc)
                    {
                    }
                }, null);

Maybe the reason of problem is something in network config. And it doesn’t work when I turn off firewall, anyway.

 

1

@andreif – is because (i hope) as david says, that the clientaccesspolicy.xml is missing. we need to wait and see if this solves the issue.

Share this post


Link to post
Guest sky.sanders

Hi,

You can get the CIAPI working if you wrap this around a silverlight web service and than invoke that for your operations in your silverlight application.

You can pull my example down from git:

https://github.com/JasonH1/cityindex/tree/master/CityIndex/examples/SilverlightApplication3

Jason, Yes, a proxy service is a cure for many ills when it comes to x-domain issues on several web client platforms including flash, silverlight and javascript. In order for a proxy to graduate from temporary workaround to viable deployment/testing option it would need to perfectly mimic/proxy the city index server and would likely involve some meta driven code generation. This is under consideration for V2 where an OAuth based authentication strategy is being considered making a local proxy required. It may be worth considering adding a proxy generator to the V1 tree but a budget for that labor needs to be discussed. So – the current best plan is to wait for the xml files to be deployed and see where we are then.

Share this post


Link to post
Guest andreif

Hi,

You can get the CIAPI working if you wrap this around a silverlight web service and than invoke that for your operations in your silverlight application.

You can pull my example down from git:

https://github.com/JasonH1/cityindex/tree/master/CityIndex/examples/SilverlightApplication3

@sky.sanders I think there is no need to mimic the whole API on proxy. HTTP-level proxy would be enough. You can just add settings for proxy connection to client API.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×