Sunday, January 6, 2013

System.ArgumentException: Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue

I was configuring one of our clients farm which required FBA on different web applications (around 5) and he wanted each web application should have separate user store. That was too tricky since you just need to set up Application property of the membership provider and you are done.

After completion of these settings, all of my applications were having a common exception either in log out or login to the web application. Here was the exception.

System.ArgumentException: Exception of type 'System.ArgumentException' was thrown.  Parameter name: encodedValue    at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Utilities.SPUtility.GetFullUserKeyFromLoginName(String loginName)     at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers)     at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea)     at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

After checking all my steps right through starting. After getting all the other exeptions cleared the above exception was the only exception that I was getting. That was resolved using "Exception of type 'System.ArgumentException' was thrown" got error when i have signout from webapplication in sharepoint 2010?.

I hope this will help to you if you are getting same error due to a silly custom property of a custom web part for registration!

5 comments:

  1. Hi Prashant,

    Where I will set this property? because there is no createuserwizard for me. I am using sp2013.

    Thanks for help.
    Ajit

    ReplyDelete
  2. Ajit

    this need to be done in membership request we part.

    also, currently new package is available for 2013 that you can use.

    let me know if you need any other help.

    thanks

    ReplyDelete
  3. Prashant,
    I'm getting this error on some users after: 1. logged on with "remember me" checked; 2: being idle for x amount of time. i've been digging and looking for 3 days and can't seem to figure out how to fix this. thanks

    [ArgumentException: Exception of type 'System.ArgumentException' was thrown.
    Parameter name: encodedValue]
    Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue) +25971126
    Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix) +296
    Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers) +845
    Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea) +352
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

    ReplyDelete
  4. we have migrated the SPS 2010 to 2013. we have used the spsecurity.runwithelevatedpriviliages(addressof methodname). We are received the error
    Error System.ArgumentException Exception of type 'System.ArgumentException' was thrown.Parameter name: encodedValue Microsoft.SharePoint~at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue) at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix) at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix) at Microsoft.SharePoint.SPSecurity.GetCurrentUserTokenNoApplicationPrincipalDelegated(SPWebApplication webApp, Uri siteUrl) at Microsoft.SharePoint.SPSecurity.GetCurrentUserToken() at Microsoft.SharePoint.SPSecurity.EnsureOriginatingUserToken() at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
    can you please help us to resolve the issue

    ReplyDelete

Please add your valuable comments about this post if it helped you. Thanks

Popular Posts