servicestack

How do I redirect after authentication in ServiceStack

纵然是瞬间 提交于 2019-12-03 03:49:22
I've overridden the CredentialsAuthProvider like so: public override bool TryAuthenticate(IServiceBase authService, string userName, string password) { //TODO: Auth the user and return if valid login return true; } public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IOAuthTokens tokens, Dictionary<string, string> authInfo) { base.OnAuthenticated(authService, session, tokens, authInfo); //User has been authenticated //Find the user's role form the DB if (roleA) //GOTO mypage1 if (roleB) //GOTO mypage2 } I perform a simple post to ~/auth/Credentials and while the

Host ServiceStack, MVC3 or MVC4 on mono or windows and what is the state of mono

China☆狼群 提交于 2019-12-03 03:44:11
I am trying to decide what stack to use for a new web based backoffice system. We develop in C# and are going to use ServiceStack and/or ASP.NET MVC. Our customer prefers hosting on a Linux server, so this rules out MVC4 as this is not supported by Mono. Additionally we are worried about the state of the mono-fastcgi-server needed to run ASP.NET on Mono because of posts like this https://serverfault.com/questions/330298/stopping-fastcgi-mono-server-gracefully-website-content-updating-with-no-need-t and because we find it very hard to find relevant and up to date information about the state of

ServiceStack OrmLite Sql Query Logging

爱⌒轻易说出口 提交于 2019-12-03 03:36:28
As per the Service Stack Ormlite documentation . I should generate the sql query in debug mode. But, I am not able to see those queries. Simple code private static readonly string DataDirLoc = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TargetIntegration\\Test\\Debug\\"; private readonly string dbFileName = DataDirLoc + "Test.db3"; [Test] public void Can_Generate_log() { //var writer = new TextWriterTraceListener(System.Console.Out); //Debug.Listeners.Add(writer); Debug.Write("this is a try"); var dbFact = new OrmLiteConnectionFactory("Data Source={0};Version=3;"

How do you implement authentication in servicestack.net

不打扰是莪最后的温柔 提交于 2019-12-03 03:09:58
问题 I'm investigating servicestack.net - but it's examples and articles don't seem to cover authentication - is this something handled by servicestack.net - and if so how? In particular I'm interested in implementing support for: OAuth (So being able to inspect the raw request and validate it/retrieve the associated user info and associate with the request prior to passing it onto servicestack.net for processing). Session/cookie based authentication (so allowing for Ajax clients which already

ServiceStack AppHost Is a Singleton?

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been evaluating ServiceStack and so far, I've been pretty much sold - but I have a requirement that I think is going to be a deal-breaker. I basically need multiple AppHost-derived instances. The first one spins up nicely, but the rest fail because "AppHostBase.Instance has already been set". Does this mean if I want multiple hosts (on different Uris), to be in different executables? If so this is rather disappointing as this library is perfect in every single other way, other than this limitation. If I am wrong, can anyone point me

ServiceStack Ormlite: System.InvalidProgramException JIT Compiler encountered an internal limitation

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Hi i'm running ServiceStack with Ormlite and I encountered this error. Previously it is working fine. I'm not sure what I have changed that caused this error. I just used a simple db.Select() call and it throws this error. I tried various ways, like updating the nuget packages, clean and rebuild the project, etc and none of them works. System . InvalidProgramException was caught _HResult =- 2146233030 _message = JIT Compiler encountered an internal limitation . HResult =- 2146233030 IsTransient = false Message = JIT Compiler

Is this a good use-case for Redis on a ServiceStack REST API?

会有一股神秘感。 提交于 2019-12-03 01:37:51
问题 I'm creating a mobile app and it requires a API service backend to get/put information for each user. I'll be developing the web service on ServiceStack, but was wondering about the storage. I love the idea of a fast in-memory caching system like Redis, but I have a few questions: I created a sample schema of what my data store should look like. Does this seems like it's a good case for using Redis as opposed to a MySQL DB or something like that? schema http://www.miles3.com/uploads/redis.png

Best design pattern to control permissions on a “per object per user” basis with ServiceStack?

主宰稳场 提交于 2019-12-03 01:22:08
问题 I know that ServiceStack provides a RequiredRole attribute to control permissions, however, this does not fully work for my use case. I have a website with a lot of user-generated content. Users can only edit documents they have explicit permissions to. Permissions are controlled per object or group of the object. So, if a user is an admin of a group then they can edit all documents managed by that group. What is the best design pattern to control access to a request on a per object per user

ServiceStack: No /swagger-ui/index.html

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using ServiceStack for my custom service, in stand alone mode without IIS. I would like to add documentation for my services beyond what /metadata does. I thought to try the Swagger plug in. I have added the plug-in command to my Config public override void Configure(Funq.Container container) { SetConfig(new EndpointHostConfig() { DefaultRedirectPath = "index.html", DebugMode = true, WriteErrorsToResponse = true, CustomHttpHandlers = { { HttpStatusCode.Unauthorized, new AuthorizationErrorHandler() }, { HttpStatusCode.Forbidden, new

ServiceStack.Redis: Unable to Connect: sPort:

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I regularly get ServiceStack.Redis: Unable to Connect: sPort: 0 or ServiceStack.Redis: Unable to Connect: sPort: 50071 (or another port number). This appears to happen when our site is busier. Redis itself appears fine, no real increase in CPU or memory usage. I'm using connection pooling and have tried changing the timeout values without success. public sealed class RedisConnection { // parameter values are: // Config.Settings.RedisPoolSize = 10000 // Config.Settings.RedisPoolTimeoutSeconds = 2 // Config.Settings.RemoteCacheServerName = 192