Implementing a custom FormsAuthenticationProvider using Owin, Katana, and Nancy -


i working on implementing custom formsauthenticationprovider , i'm getting middleware conversion error.

no conversion available between system.func`2[system.collections.generic.idictionary`2 [system.string,system.object],system.threading.tasks.task] , microsoft.owin.owinmiddleware parameter name: signature 

my stack includes

  • owin
  • katana
  • nancy

my specific question advice on example on how implement custom formsauthenticationprovider? unless can spot problem.

my implementation looks like:

startup.cs

app.useformsauthentication(new formsauthenticationoptions             {                 loginpath = "/login",                 logoutpath = "/logout",                 cookiehttponly = true,                 authenticationtype = constants.chainlinkauthtype,                 cookiename = "chainlink.id",                 expiretimespan = timespan.fromdays(30),                 provider = kernel.get<iformsauthenticationprovider>()             }); 

if remove app.useformsauthentication(...) application runs without error.

full stack trace

[argumentexception: no conversion available between system.func`2[system.collections.generic.idictionary`2[system.string,system.object],system.threading.tasks.task] , microsoft.owin.owinmiddleware parameter name: signature]    owin.builder.appbuilder.convert(type signature, object app) +328    owin.builder.appbuilder.buildinternal(type signature) +336    owin.builder.appbuilder.build(type returntype) +42    microsoft.owin.host.systemweb.owinappcontext.initialize(action`1 startup) +650    microsoft.owin.host.systemweb.owinbuilder.build(action`1 startup) +86    microsoft.owin.host.systemweb.owinbuilder.build() +185    system.lazy`1.createvalue() +416    system.lazy`1.lazyinitvalue() +152    system.lazy`1.get_value() +75    microsoft.owin.host.systemweb.owinapplication.get_instance() +35    microsoft.owin.host.systemweb.owinhttpmodule.init(httpapplication context) +106    system.web.httpapplication.registereventsubscriptionswithiis(intptr appcontext, httpcontext context, methodinfo[] handlers) +418    system.web.httpapplication.initspecial(httpapplicationstate state, methodinfo[] handlers, intptr appcontext, httpcontext context) +172    system.web.httpapplicationfactory.getspecialapplicationinstance(intptr appcontext, httpcontext context) +336    system.web.hosting.pipelineruntime.initializeapplication(intptr appcontext) +296  [httpexception (0x80004005): no conversion available between     system.func`2[system.collections.generic.idictionary`2[system.string,system.object],system.threading.tasks.task] , microsoft.owin.owinmiddleware parameter name: signature]    system.web.httpruntime.firstrequestinit(httpcontext context) +9874568    system.web.httpruntime.ensurefirstrequestinit(httpcontext context) +101    system.web.httpruntime.processrequestnotificationprivate(iis7workerrequest wr,  httpcontext context) +254 

executable source code (just f5 , you'll error immediately)

https://github.com/cnwilkin/chainlink/tree/spike

can try updating version of microsoft.owin.host.systemweb package latest rc , try? have other owin* dlls in rc 1.0.0. causing issue. please use microsoft.owin.security.cookies instead of microsoft.owin.security.forms. forms package has been renamed cookies now.


Comments