servicestack

ServiceStack: Get email from auth session when authenticating with Google

别等时光非礼了梦想. 提交于 2019-12-07 07:30:40
问题 I am authenticating users via GoogleOpenIdOAuthProvider. I need to access the email address of the user that logged in. I have attempted to implement the Using Typed Sessions in ServiceStack code as-is. So, I created a base class that my service inherits from: public abstract class AppServiceBase : Service { //private CustomUserSession userSession; protected CustomUserSession UserSession { get { return base.SessionAs<CustomUserSession>(); } } } public class CustomUserSession : AuthUserSession

How do we integrate elmah logging in servicestack

家住魔仙堡 提交于 2019-12-07 05:55:12
问题 I am new to servicestack and elman logging. Can any body suggest how do we integrate elmah in service stack applications. Thank you... 回答1: If you have an existing logging solution then you can use the ServiceStack.Logging.Elmah project. It is available via NuGet. Exceptions, errors and fatal calls will be logged to Elmah in addition to the originally intended logger. For all other log types, only the original logger is used. So if you are already using Log4Net then you can just configure

Documenting ServiceStack web services [closed]

老子叫甜甜 提交于 2019-12-07 05:23:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . What are the options for documenting a ServiceStack bases web services and I'm not talking about a one line string. I would like to be able to document, in detail (which can be long), return types, possible HTTP responses, add detailed examples etc. Is there any support for this in

ServiceStack “new” api and async await

99封情书 提交于 2019-12-07 04:47:20
问题 ServiceStack version 3 I'm quite familiar with https://github.com/ServiceStack/ServiceStack/wiki/New-API and on this page it specifically says "All these APIs have async equivalents which you can use instead, when you need to." Is it possible to use async await with ServiceStack's new api? What would the server and client code look like with async await? [Route("/reqstars")] public class AllReqstars : IReturn<List<Reqstar>> { } public class ReqstarsService : Service { public List<Reqstar> Any

ServiceStack turn on Razor intellisense support without MVC

孤人 提交于 2019-12-07 03:06:22
问题 I have installed SS.Razor into my test project. If i simply change default.htm -> cshtml, it works, but without vs intellisense syntax support. So the razor code is plain text black and white. I wonder how to turn on Razor without opening up the project as a .net MVC project. Thank you! EDIT ------------------------------------------ Here is my web.config (note the add extension=".cshtml" ... is there ...) <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <sectionGroup

SSL on Service Stack

别等时光非礼了梦想. 提交于 2019-12-07 02:53:16
问题 Is SSL supported on Service Stack on Mono? I only have access to a mac and the instructions I found here ask you to use a windows tool to create a pvk file: http://joshua.perina.com/geo/post/using-ssl-https-with-mono-httplistener The site is hosted as a linux daemon process using an upstart script to keep the server up. 回答1: I ended up writing some code in my app host to enable SSL support for Service Stack, which uses HttpListener under the covers. Here is some code that will enable SSL for

ServiceStack Razor inherits directive has no intellisense

纵饮孤独 提交于 2019-12-07 02:50:32
问题 I'm learning ServiceStack razor and wanted to get better with it(ServiceStack in general), I can't get the intellisense to work on models(via inherits directive) though Here's my attempt so far: http://www.ienablemuch.com/2012/12/self-hosting-servicestack-serving.html 回答1: I've explained the troubles I've had with getting Razor Intelli-sense to work here basically it's delicate to get it working that I've now decided it's better to first focus on upgrading to use the current (backward

How to serialize ExpandoObject using ServiceStack JsonSerializer?

别等时光非礼了梦想. 提交于 2019-12-07 02:32:23
问题 Is it possible to get the ServiceStack JsonSerializer to serialize an ExpandoObject as a flat object rather than a dictionary? Something roughly approximate to this: {"x":"xvalue","y":"\/Date(1313966045485)\/"} I am trying to compare JSON serialization of ExpandoObject using three different systems: the .NET BCL JavaScriptSerializer, Newtonsoft JSON.NET, and ServiceStack's JSON offering. I start with a fairly simple dynamic object. dynamic test = new ExpandoObject(); test.x = "xvalue"; test.y

Does ServiceStack support Token based authentication?

允我心安 提交于 2019-12-06 15:58:57
Asp.net Web api has out of the box support for token based authentication with minor configuration settings. I havent found anything like that for servicestack. Is there anyway how I can setup servicestack to provide tokens on authentication instead of session id. ServiceStack includes support for JWT built-in there are also a couple of other projects that enable token-based authentication with ServiceStack: StatelessAuthentication Using IdentityServer 4 with ServiceStack and Angular Auth0 ServiceStack Integration ServiceStack JWT Token validation for Auth0 来源: https://stackoverflow.com

How do I iterate across all sessions in ServiceStack?

为君一笑 提交于 2019-12-06 15:53:19
Our application has companies and uses in each company. Each company has X number of licenses. We are using a typed session class, and that class contains the id of the company along with other user information. I need to add to our authentication process, a check to see if the current login will exceed a company's licenses. I believe that the way to do this is to get a count of all company Ids across all sessions that match the companyId of the user currently trying to log in, and compare that count to the number of available licenses in our company table. Is this a valid approach? If so,