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 7277803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:47:25+00:00 2026-05-28T22:47:25+00:00

I have just started reading on implementing RESTful web services and creating RESTful apis.

  • 0

I have just started reading on implementing RESTful web services and creating RESTful apis. I have understood the basic concept of REST but I have been scratching my head a bit on how I will implement it securely?

Say for example, my webapp has a user login process. After successfully logging in, what else should I pass in the RESTful request to authenticate on server???
What I can think of is the following process:

  • user logs in (POST username/password to API)
  • API responds with a userkey
  • userkey is stored locally
  • When making any further requests, I include this key in request be authenticated

But here it seems that userkey is a state which I am sending to API, but REST happens to be stateless. Also this is not too secure in case of sending GET requests.

Is OAUTH the solution to my dilemma? Or some other way? Can somebody guide me on this…

Thanks

  • 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-28T22:47:26+00:00Added an answer on May 28, 2026 at 10:47 pm

    UserKey, or better call it token, is a client-side state. Your RESTful API will remain stateless since it stores this token no where.

    Usually this token is a combination of some segments (username, password, login date) hashed as MD5, SHA (or any other algorythm). Whenever client calls an operation of your RESTful API, your service will compare the incoming token with an on-the-fly generated one using the same segments. If both generated tokens are equal, request gets authenticated.

    There’s no problem with GET or POST methods: you’ll need to retrieve your token from query string or an HTTP header.

    The point to secure your connection is calling your RESTful API over SSL, so your communications will have a high degree of security.

    An important problem with GET and sending this token using query strings is maybe it’s too long and URL length limitations would prevent you from having a lot of arguments in addition to the token itself.

    In my opinion, you should go with POST verb, because you can send more data, it’s more flexible and you avoid giving problematic arguments in query string, which can be bad in terms of logging, since you’re going to log user names, passwords, tokens and other things, which are sensitive information that can compromise your users if a hacker steals your logs (or some unwanted person checks your log too).

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

Sidebar

Related Questions

I knw its pretty basic question but I have just started reading it... I
We have a bunch of data on S3 (images) but just started reading about
I've only just really started android developing and have been reading about services here
I have just started reading about neural networks and I have a basic question.
I have just started reading Modern C++ Design Generic programming and Design Patterns Applied
I just have started to learn Haskell and combine reading books and tutorials with
I have just started reading Spring In Action - Third edition and am stuck
I have just started reading up on Lucene. In one of the examples provided,
I am not a C programmer. I have just started reading K&R's TCPL last
I've just started reading C and have a question about a macro. How can

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.