Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7000287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:39:05+00:00 2026-05-27T20:39:05+00:00

How do I add a security layer to my REST application, I am both

  • 0

How do I add a security layer to my REST application, I am both in control of my server and client,
I am using NANCY as a server and RESTsharp as client.

I have hard time understanding how to make calls secure if REST support to be stateless.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:39:05+00:00Added an answer on May 27, 2026 at 8:39 pm

    Christian’s comment may be sufficient for your needs. It shows how to use the Nancy add-ins for Basic or FormsAuth and RESTSharp does support Basic auth right out of the box.

    I’ve been building a Nancy driven REST API at work for quite some time now, we’ve used both RESTSharp as well as plain HTML+JS as clients and we chose to implement our own session based authentication (partly because those add-ins didn’t exist when we implemented). However what is nice about it, is how simple it is to use regardless of what the client supports. I’ll quickly explain how it works.

    The client sends their username and password (or if you like, identifier and secret key) to create a new session resource using POST /sessions (use HTTPS). This resource contains a session key which can be used for subsequent calls. The session expires after X minutes of inactivity.

    Each call made to the service requires a valid session key (except creating a session). The key is provided either as a cookie or in the query string. When using RESTSharp we usually set this as a cookie and just keep reusing it unless it’s expired.

    Finally, the session can be destroyed by calling DELETE /session/{key}.

    This is a simple, but effective (assuming HTTPS) way to secure a REST API.

    Alternatively you could implement OAuth, which RESTSharp also apparently supports out of the box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if I should add an SSL layer between my server and client.
We are looking to add TLS (transport layer security) support to our software, and
I have a webapp that requires security beyond that of a normal web application.
I'm trying to add some security to my ASP.NET 1.0 MVC app (VB), but
I'm new to Spring Security. How do I add an event listener which will
We add Struts errors and messages using ActionSupport.addActionError(...) and addActionMessage(...) and then output the
I add many check boxes to the excel sheet programaticaly using the following code:
I developed 65 SSRS 2008 reports and now I want to add a layer
I have an app that is saving to a db (using Entity Framework) and
I have a problem generating a gSOAP security header (WSSE). I have compiled all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.