azure - Self-hosted Owin, static files and authentication -
azure - Self-hosted Owin, static files and authentication -
i need embed little owin host in azure worker role. need serve static files, sub-directory should password-protected. couldn't find illustration on self-hosted apps authentication.
i'm trying setup next appbuilder:
func<cookievalidateidentitycontext, task> validate = async context => { logger.trace("access"); }; var authoptions = new cookieauthenticationoptions { authenticationmode = authenticationmode.active, authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/login.html"), provider = new cookieauthenticationprovider { onvalidateidentity = validate, onapplyredirect = redirect, onresponsesignin = signin } }; appbuilder.usecookieauthentication(authoptions); appbuilder.usestagemarker(pipelinestage.authenticate); var basepath = getbasepath(); var webpath = path.combine(basepath, "web"); var physicalfilesystem = new physicalfilesystem(webpath); var options = new fileserveroptions { enabledefaultfiles = true, enabledirectorybrowsing = true, filesystem = physicalfilesystem }; options.staticfileoptions.filesystem = physicalfilesystem; options.staticfileoptions.serveunknownfiletypes = true; options.defaultfilesoptions.defaultfilenames = new[] { "index.html" }; appbuilder.usefileserver(options); i'm stuck 2 problems:
the logger.trace("access") breakpoint never hit how should define login.html page? should contain form? how can handle post action? azure asp.net-identity owin
Comments
Post a Comment