none
Visual Studio ASP.NET Active Directory Federation Services Authentication - sample project RRS feed

  • Question

  • Hello,

    First of all, I'm not sure if this fits in here...

    Some background information:

    • I'm a newbie in web development, so please be gentle ;)
    • I want to create a ASP.NET application using Active Directory authentication
    • The webapp should be accessible internally and externally
    • The user should log in with his / her AD-User
    • I'm trying to get the VS-created sample webapp running
    • The webapp should not use Azure
    • I'm running VS2017 Community

    As far as I understand the authentication methods, "Windows authentication" is not suitable for non-intranet applications...
    "Individual User Accounts" are not authenticated by the AD...? Then theres's "Work and School Accounts" left...

    Alright. To create a Project I need to type in the FederationMetadata.xml path.

    (I wanted to add a picture here, but I'm not verifyed yet^^)

    So I went and created a single VM running AD Services and AD FS Services... I've created a Self Signed Cert and added it during the configuration... I now can access the the FederationMetadata.xml from my machine running VS2017...

    Ok, after that I successfully created the Project and tired to run it... (I did not change anything!)

    I'm getting the following error:

    (I wanted to add a picture here, but I'm not verifyed yet)

    The following errors occurred while attempting to load the app.
    - No assembly found containing an OwinStartupAttribute.
    - No assembly found containing a Startup or [AssemblyName].Startup class.
    To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
    To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.
    
    -----------------------------------------------------
    
    [EntryPointNotFoundException: The following errors occurred while attempting to load the app.
     - No assembly found containing an OwinStartupAttribute.
     - No assembly found containing a Startup or [AssemblyName].Startup class.
    To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
    To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.]
       Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +357
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
       System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +536
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +218
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
    
    [HttpException (0x80004005): The following errors occurred while attempting to load the app.
     - No assembly found containing an OwinStartupAttribute.
     - No assembly found containing a Startup or [AssemblyName].Startup class.
    To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
    To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10075108
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

    And here I am now... I guess there's something wrong with my AD FS configuration...
    Can someone push me in the right direction? I'm kinda stuck here...

    Also, I know I could authenticate the users against the AD using the System.DirectoryServices.AccountManagement or System.DirectoryServices.ActiveDirectory namespace... What method (namespaces or AD FS) would you suggest me?

    Thanks alot for your time & help!

    Regards,
    Shane

    • Moved by CoolDadTx Monday, May 6, 2019 1:51 PM ASP.NET related
    Sunday, May 5, 2019 4:21 PM

All replies

  • First of all, I'm not sure if this fits in here...

    ASP.NET issues can be discussed at the ASP.NET forums.

    http://forums.asp.net/

    Monday, May 6, 2019 3:51 AM