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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:37:37+00:00 2026-06-09T20:37:37+00:00

I am building an application which requires the user to login at start-up. The

  • 0

I am building an application which requires the user to login at start-up.

The authentication process is as follows:

  • User inputs username / password.
  • client sends username + password to Web Service.
  • Web Service authenticates the user with hashed password from the DB.
  • Web Service returns a token to the client which contains one of those three values:

    1) Username is invalid.

    2) Password is invalid.

    3) User is authenticated.

  • The token is used by the client to determine the next course of action.

  • The token is passed to the service with every subsequent calls made by the client. The service rejects the call if the user is not authenticated.

The token is encapsulated within a DTO, which is a DataContract. The token itself is a DataMember. DataMembers require that the property have a setter and a getter. This means that clients are now able to set a value for the token, which is bad. Clients could now technically flag themselves as authenticated.

How would I go about preventing clients from modifying the value of the token ? Are there any patterns that could help me here ?

  • 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-06-09T20:37:38+00:00Added an answer on June 9, 2026 at 8:37 pm

    The server must ‘know’ the token and validate it.

    There’s no way that you can restrict the client from changing the token. Think about it – I send you a DTO, basically a bundle of information. Later on, you send that bundle back to me. How could I possible stop you from changing what’s in the bundle? The only thing I can do is check that the bundle is valid, you haven’t changed anything that I don’t expect you to change, and so on.

    If your token is a simple authenticated flag then that’s a bit of a disaster. Imagine a website that accepted a logged in parameter that just trusted me. You tell the webserver that you’re logged in and it believes you? www.visa.com/account.html?account=123456&loggedIn=true doesn’t seem very secure.

    In platform agnostic world you can use encryption to create a secure token that can be validated. You already have a token, so perhaps you could add some encrypted content to the token that validates a user. The client doesn’t know what the data is, and can’t decrypt it easily. They need to return the token to the server on each request. The server can decrypt the token which confirms that the user is authenticated.

    Of course the tokens need to expire, and need to be secure and un-guessable. In a Windows world it might be simpler to use Windows authentication, or one of the rolled-in .NET authentication patterns.

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

Sidebar

Related Questions

I am in the process of building a rails/flex application which requires audio to
Goal: Allow a user to authentication with Facebook into an iOS application which requires
I'm building a small php-based application which requires a config.php file containing a username
I'm working on building an android application which requires different levels of authentication, and
I'm building an MVC application which uses Windows Authentication. I want to handle a
I am building an application which requires me to make use of DataContext's inside
I am new to mongoDB. I am working on building an application which requires
We are building an application which requires a daily insertion of approximately 1.5 million
I'm building an android app which requires me to prompt the user for his
I'm building a site that requires user authentication and authorization. My initial idea was

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.