servicestack

ServiceStack Basic Authentication HtmlRedirect is not respected by MVC ServiceStackController

做~自己de王妃 提交于 2019-12-11 08:47:56
问题 I'm probably not understanding something but I have the issue below: AppHost.cs Plugins.Add(new AuthFeature( () => new AuthUserSession(), new IAuthProvider[] { new BasicAuthProvider() }) { HtmlRedirect = null }); HomeController.cs [Authenticate] public class HomeController : ServiceStackController The issue The issue is that when I try to access the HomeController, I am redirected to ~/login?redirect=.... . I would assume that by setting HtmlRedirect to null, would also affect the MVC

ServiceStack OrmLite mapping with references not working

。_饼干妹妹 提交于 2019-12-11 08:45:24
问题 I'm trying out OrmLite to see if I can replace Entity Framework in my projects. The speed is quite significant on simple queries. But I tried to map/reference a [1 to many- relation and read the documentation + examined the test code from the github page but without success. This is my example. Is there something I've forgot or should do to get it working like Entity Framework? Example // EF: returns +15.000 records + mapped > product.StockItems (slow) dbContext.Products.Include(x => x

ServiceStack F# sample fails starting

风格不统一 提交于 2019-12-11 08:25:41
问题 I'm trying to run this Self Hosting example, using latest ServiceStack release (4.0.3) and latest Mono/F# (3.2.5). It fails with an exception on appHost.Init() : { System.IO.FileNotFoundException: Virtual file not found File name: '<>.FSharpSignatureData.' at ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile (System.String resourceName) [0x00033] in <>/ServiceStack/VirtualPath/ResourceVirtualDirectory.cs:99 } System.IO.FileNotFoundException The same does not happen with the

ServiceStack 4.5 configure log4net programmatically

眉间皱痕 提交于 2019-12-11 08:11:46
问题 I am starting a new project with ServiceStack 4.5. Is there any way to configure log4net programmatically? In the documentation I found LogManager.LogFactory = new Log4NetFactory(configureLog4Net: true); I added this to the constructor of the AppHost class. However this seems to assume that you put the configuration to the App.config file (I am doing self-hosting on a windows service). In some other projects I wrote a singleton and then used the Log4Net API to do the configuration: private

How can I populate a UserAuth from values in Redis?

可紊 提交于 2019-12-11 08:08:59
问题 This is my custom user authentication setup in my global.asax file, but I am currently providing the users manually in the Configure method; Is it possible to take values from a Redis server? For example if user exists and the password is okay, can fill with these details automatically? Plugins.Add(new AuthFeature(()=> new AuthUserSession(), new IAuthProvider[]{ new BasicAuthProvider() } )); container.Register<ICacheClient>(new MemoryCacheClient()); var userRepo = new InMemoryAuthRepository()

Cors configuration issues when using ServiceStacks JsonServiceClient

喜你入骨 提交于 2019-12-11 07:58:26
问题 I have issues when trying to Post data to my API using ServiceStack's JsonServiceClient. I get the following error message in the console Access to fetch at 'https://192.168.10.191:5001/json/reply/CreateEquipment' from origin 'http://192.168.10.191:5000' has been blocked by CORS policy: Request header field headers is not allowed by Access-Control-Allow-Headers in preflight response. I have added 192.168.10.191:5000 to the Whitelist. I can see in the network tab that it tries to access "https

nullreference exception when adding session cookie to ServiceStack

走远了吗. 提交于 2019-12-11 07:49:21
问题 This question relies quite a bit on the question/answer here: Reconnecting to Servicestack session in an asp.net MVC4 application Basically, I have an asp.net MVC application that is using ServiceStack for authentication. As suggested in the question mentioned above I am adding a session cookie to the response and then adding it to the jsonserviceclient cookie container later. Using this code to authenticate the user at the login screen: [AcceptVerbs(HttpVerbs.Post)] public ActionResult login

Mess in ServiceStack version 5

空扰寡人 提交于 2019-12-11 07:36:43
问题 I have a ASP.NET Core application hosted in Windows Sercice, so it is a .NETCore project but TargetFramework is .NET Framework. This Microsoft document describes this kind of project. The application works fine with SerciceStack.Core 1.0.44, here goes the snippet of my project file. <PackageReference Include="ServiceStack.Core" Version="1.0.44" /> <PackageReference Include="ServiceStack.Kestrel" Version="1.0.44" /> <PackageReference Include="ServiceStack.Text.Core" Version="1.0.44" />

Custom session not working with Authenticate

99封情书 提交于 2019-12-11 07:34:12
问题 I'm trying to design a solution where a ServiceStack server can just use an authentication cookie from ASP.NET. (In reality, it could be any cookie. It's just getting a session ID that it can lookup details using a back channel). The custom auth providers don't seem to be the right direction since they are based on credentials being sent. Instead, a GlobalRequestFilter made more sense to me. In there, I check the cookie, get the external session information, then set them to the ServiceStack

Calling ServiceStack.Text.JsConfig.RegisterTypeForAot<T>(); with MonoTouch causes SIGSEGV on startup on device

社会主义新天地 提交于 2019-12-11 07:31:44
问题 I've been trying to use ServiceStack.Text.JsConfig.RegisterTypeForAot(); in an method that is not used at runtime to cure my AOT issues but have run into other weird issues when I have too many calls to it. I've got 10 calls to various types including classes, structs and enums. When I have 9 calls everything works fine, I've shuffled some of the types around so I'm pretty sure it is the number. When I have 10 calls I get ... Stacktrace: at System.MonoType.ToString () [0x00000] in /Developer