private void ConfigureOAuthTokenGeneration(IAppBuilder app)
        {
            app.CreatePerOwinContext(NdDbContext.Create);
            app.CreatePerOwinContext <NdUserManager>(NdUserManager.Create);
            app.CreatePerOwinContext <NdRoleManager>(NdRoleManager.Create);

            OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/api/oauth/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
                Provider = new NdOAuthProvider(),
#if DEBUG
                AccessTokenFormat = new NdJwtFormat("http://localhost/NetDiet/Therapist")
#else
                AccessTokenFormat = new NdJwtFormat("http://therapistapi.mintest.dk/")
#endif
            };

            app.UseOAuthAuthorizationServer(OAuthServerOptions);
        }
        private void ConfigureOAuthTokenGeneration(IAppBuilder app)
        {
            app.CreatePerOwinContext(NdDbContext.Create);
            app.CreatePerOwinContext <RsUserManagerWithMessageService <NdUser, NdDbContext, NdEmailService> >(
                RsUserManagerWithMessageService <NdUser, NdDbContext, NdEmailService> .Create);
            app.CreatePerOwinContext <RsRoleManager <NdUser, NdDbContext> >(RsRoleManager <NdUser, NdDbContext> .Create);

            OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/oauth/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
                Provider = new NdOAuthProvider(new DefaultLogger()),
#if DEBUG
                AccessTokenFormat = new RsJwtFormatProvider("http://localhost/NetDiet/Therapist")
#else
                AccessTokenFormat = new NdJwtFormat("http://mintest.dk/")
#endif
            };

            app.UseOAuthAuthorizationServer(OAuthServerOptions);
        }