Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Mobile API Client 401 response #5827


User avatar
0
josus created

Hi,

I am fighting with this issue since last friday and I can't solve it. I am writing a new Mobile Application from scratch using Xamarin and FreshMVVM framework. I am not using any abp nuget because some of them cause a incompatibility issue with the IOS project. So, I already have the Login running by calling the api/Account endpoint. I have my token and all seems to work fine. But when I try to make a call to a secured endpoint the server response is always 401. If I debug the server side, the Bearer header is sent by the client, but ABSSession has no Tenant or User Info set.

I tried to see how you manage this in your samples (DevExpressDemo and PhoneBook), but the references in those projects breaks the IOS project. I am very frustrated because I can't find any clue to follow about this.

I would appreciate a lot if you can give me any tip.

Regards.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    You also need to send Abp.TenantId in the request header with the value as selected tenat id.

  • User Avatar
    0
    josus created

    Let me try, what is the header name? Abp.TenantId?

  • User Avatar
    0
    josus created

    I am trying to run the solution that comes with my aspnetzero download package. After connected it throws this exception:

    ComponentActivator: could not instantiate FBS.TimeMachine.Views.LoginView

    I am running on Mac OS with Visual Studio 2017.

  • User Avatar
    0
    alper created
    Support Team

    Use AbpApiClient for your server side communication. AspNet Zero Xamarin application uses this class to transfer data to server.