Open Closed

Xamarin iOS and CryptographicException: Padding is invalid and cannot be removed #7807


0
mika created

Hi

Angular + Core, v7.0.0 Android works, Angular client works, Postman api call from another computer works.

I try to debug my iOS mobile app but when I try to check if tenant is awailable I get this error on server:

:11,393 [172  ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST http://192.168.1.108:22742/api/services/app/Account/IsTenantAvailable application/json; charset=utf-8 27
INFO  2019-10-08 19:18:11,394 [172  ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'MyCompany.MyApp.Authorization.Accounts.AccountAppService.IsTenantAvailable (MyCompany.MyApp.Application)'
INFO  2019-10-08 19:18:11,403 [172  ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "app", action = "IsTenantAvailable", controller = "Account"}. Executing action MyCompany.MyApp.Authorization.Accounts.AccountAppService.IsTenantAvailable (MyCompany.MyApp.Application)
ERROR 2019-10-08 19:18:11,435 [172  ] Mvc.ExceptionHandling.AbpExceptionFilter - Padding is invalid and cannot be removed.
System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
   at Internal.Cryptography.UniversalCryptoDecryptor.DepadBlock(Byte[] block, Int32 offset, Int32 count)
   at Internal.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at Internal.Cryptography.UniversalCryptoTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
   at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Security\SimpleStringCipher_NetStandard.cs:line 132
   at Abp.MultiTenancy.TenantCache`2.CreateTenantCacheItem(TTenant tenant) in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\MultiTenancy\TenantCache.cs:line 91
   at Castle.Proxies.Invocations.TenantCache`2_CreateTenantCacheItem.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.TenantCache`2Proxy.CreateTenantCacheItem(Tenant tenant)
   at Abp.Runtime.Caching.CacheExtensions.<>c__DisplayClass5_0`2.<Get>b__0(String k) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheExtensions.cs:line 40
   at Abp.Runtime.Caching.CacheBase.Get(String key, Func`2 factory) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheBase.cs:line 68
   at Abp.Runtime.Caching.CacheExtensions.Get[TKey,TValue](ICache cache, TKey key, Func`2 factory) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheExtensions.cs:line 40
   at Castle.Proxies.Invocations.ITenantCache_GetOrNull.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.TenantCache`2Proxy.GetOrNull(Int32 tenantId)
   at Abp.MultiTenancy.TenantStore.Find(Int32 tenantId) in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\MultiTenancy\TenantStore.cs:line 14
   at Abp.MultiTenancy.TenantResolver.GetTenantIdFromContributors() in D:\Github\aspnetboilerplate\src\Abp\MultiTenancy\TenantResolver.cs:line 88
   at Abp.MultiTenancy.TenantResolver.ResolveTenantId() in D:\Github\aspnetboilerplate\src\Abp\MultiTenancy\TenantResolver.cs:line 59
   at Abp.Runtime.Session.ClaimsAbpSession.get_TenantId() in D:\Github\aspnetboilerplate\src\Abp\Runtime\Session\ClaimsAbpSession.cs:line 62
   at Abp.Auditing.AuditingHelper.CreateAuditInfo(Type type, MethodInfo method, IDictionary`2 arguments) in D:\Github\aspnetboilerplate\src\Abp\Auditing\AuditingHelper.cs:line 104
   at Abp.AspNetCore.Mvc.Auditing.AbpAuditActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Mvc\Auditing\AbpAuditActionFilter.cs:line 34
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

Any adwise?


2 Answer(s)
  • 0
    mika created

    Newer mind..

    I tested app against my staging server and then changed base url to localhost and then I had staging server tenancy details so I think it messed things up..

    I reinstalled app to my ios phone and now that api call works.

  • 0
    alper created

    great!