Servicestack,Xamarin和身份验证

时间:2015-09-08 12:46:33

标签: authentication xamarin servicestack

我有一个运行自定义身份验证的ServiceStack服务,这可以通过浏览器和Windows控制台程序运行良好。 我现在正试图让一个简单的Xamarin Android程序进行身份验证,但无论我尝试什么,它都会在没有任何进一步解释的情况下崩溃。我正在使用的代码停在' var authResponse',我使用4.0.44 ServiceStack软件包和VS2015内部最新的稳定Xamarin。

        protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        // Set our view from the "main" layout resource
        SetContentView (Resource.Layout.Main);
        // servicestack
        var client = new JsonServiceClient("http://10.0.2.2:8080");
        var authResponse = client.Get<AuthenticateResponse>( new Authenticate
        {
            UserName = "Willem",
            Password = "secret",
            RememberMe = true
        });

指向我应该看什么/哪里的指针? TIA

1 个答案:

答案 0 :(得分:2)

如果这是一个自托管服务,您需要通过监听主机通配符来注册HttpListener AppHost以接受来自不同主机的请求,例如:

appHost.Start("http://*:8080/");