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

  • Home
  • SEARCH
  • 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 6173071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:30:15+00:00 2026-05-23T23:30:15+00:00

Ok so I am creating an API for manipulating users and data in a

  • 0

Ok so I am creating an API for manipulating users and data in a web application using XML. If they POST XML they can create users, etc. I am using a 2-legged OAuth solution to secure and verify the API requests. However this question is not about that aspect of security, but the aspect I will describe is for allowing the user to login from an API request without having to type their username and password, here is what I have:

Step 1, partner uses XML API to create a user, if successful the system returns a path containing the new ID, “/user/99” for example.

Step 2, partner makes a request to user/login/99, this will create a new “Login Token” in my database, here are the relevant properties:

UserID      int     FK
AccountID   int     FK
Token       string
Expiration  date
Used        bit

UserID and AccountID are related to the respective Users and Accounts table…

the Token is the first 20 characters of a randomly generated GUID with the dashes removed and all characters set ToUpper().

The Expiration is 30 seconds from DateTime.Now.

Used = false

Step 3, the partner will have knowledge of the URL of the system (which is on a different domain from the API), and they can now make a POST to it like this:

http://otherdomain.webapp.com/core/login/%5Binsert guid here]

Now, the ‘otherdomain’ part is going to be unique per account, so at this point we verify:

Look up the LoginToken based on the provided guid, if it goes with the account that matches the subdomain, is NOT expired (within 30 seconds), AND ‘Used’ is set to false still, log the user in, set Used = true, direct them to the homepage or to another URL if one was provided via querystring.

So basically you NEED a complete registered App and secret key and all the jazz for OAuth simply to REQUEST the GUID which allows you to login but only works ONE time and within a 30 second window… and they need to have knowledge of the login URL in the first place, IS THIS GOOD ENOUGH?

In the end if someone can somehow know the GUID and the URL all within 30 seconds they could hi-jack the login, but what are the chances of that?

Alternatively, what could I add to make it more secure?

  • 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-23T23:30:15+00:00Added an answer on May 23, 2026 at 11:30 pm

    (Disclaimer: I am not a security expert.)

    The immediate problem that I notice is this:

    http://otherdomain.webapp.com/core/login/[insert guid here]

    Based on your setup, the GUID token has to be given to the user when it’s requested. That’s effectively the password for the request. If you send it over HTTP, anybody who can snoop the connection has the token and it wouldn’t be hard to hijack the session. This absolutely must use SSL for the entire process.

    Beyond that, the problem is that you’re sending the token to the user before they can use it, which isn’t great. But with SSL it may very well be good enough for your purposes. I’ve used a similar method when dealing with a protocol that can’t handle normal authentication, the user connects over the secured channel first and says “I want to do a transfer on the other one”, and the server sends back a token they can use for that request. It works well enough on a low-security system. If you’re protecting critical data, I’d strongly recommend you invest the money to bring in an expert to look at it before going to production.

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

Sidebar

Related Questions

When creating a child process in C++ using Windows API, one can allow inheritance
We're creating an XML API for Joomla that allows partner sites to create new
I was trying to hit a web service using the instructions here: http://help.seeclickfix.com/kb/api/creating-an-issue I
I am currently in the process of creating API documentation using Microsoft Word 2007
I'm creating a simple API that creates typed classes based on JSON data that
I'm creating a small service using api-libraries, such as Twitter. Is it possible to
I'm creating .net websites against a CMS server using the API of the software
I am in need of creating a rest api for syncing data with my
I am creating an API using PHP and MongoDB. In this system I got
I'm creating an web api and need a good way to very quickly generate

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.