Error while adding a custom token handler
-
Friday, October 22, 2010 7:26 AM
Hi there,
I've read a load of examples and threads with regards to add a custom token handler.
However, I have a problem with configuration which in web.config.
<microsoft.identityModel>
<service>
<securityTokenHandlers>
<!--<remove type="Microsoft.IdentityModel.Tokens.UserNameSecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />-->
<remove type="Microsoft.IdentityModel.Tokens.WindowsUserNameSecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add type="CustomUserNameSecurityTokenHandler"/>
</securityTokenHandlers>
</service>
</microsoft.identityModel>With this configuration, I got following exception ...
ID0006: The input string parameter is either null or empty. Parameter name: value Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: ID0006: The input string parameter is either null or empty. Parameter name: value Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentException: ID0006: The input string parameter is either null or empty. Parameter name: value] Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.set_Issuer(String value) +187 Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.InitializePropertiesFromConfiguration(ServiceElement element) +60 Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.InitializePropertiesFromConfiguration(String serviceName) +43 Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.InitializeModule(HttpApplication context) +327 Microsoft.IdentityModel.Web.HttpModuleBase.Init(HttpApplication context) +33 System.Web.HttpApplication.InitModulesCommon() +80 System.Web.HttpApplication.InitModules() +43 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
Thanks!
All Replies
-
Wednesday, March 21, 2012 3:01 PM
I get the same error. Have a solution for me?
-
Thursday, April 05, 2012 2:17 PM
You are getting this error probably because your microsoft.identityModel section is missing the following element:<federatedAuthentication> <wsFederation passiveRedirectEnabled="true" issuer="your identity provider URL" realm="your relaying party URL" requireHttps="true" /> </federatedAuthentication>

