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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -