How do you implement authentication in servicestack.net

前端 未结 1 1011
情话喂你
情话喂你 2021-01-31 03:54

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?

<
相关标签:
1条回答
  • 2021-01-31 04:47

    Edit: There is now a new Authentication provider model in ServiceStack with the following built-in providers:

    • Credentials - For authenticating with username/password credentials. e.g. Form Auth
    • Basic Auth - Allowing users to authenticate with Basic Authentication
    • Twitter OAuth - Allow users to Register and Authenticate with Twitter
    • Facebook OAuth - Allow users to Register and Authenticate with Facebook

    The new auth provider model is entirely optional and is a user-level library built on top of ServiceStack's existing Request / Response filters.

    For more info on how to create your own check this thread for authentication options in ServiceStack.

    https://groups.google.com/d/topic/servicestack/U3XH9h7T4K0/discussion

    Basically you can use Request filters to intercept the request or a base class to add generic validation logic. The thread contains examples of both options.

    Alternatively you can host ServiceStack together with another ASP.NET web framework so you can use its built-in auth provider, and just validate a valid user session in ServiceStack using Request Filters and cookies.

    Here's an example of implementing HTTP Basic Auth with Request filters

    0 讨论(0)
提交回复
热议问题