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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:05:12+00:00 2026-05-16T09:05:12+00:00

Some time ago we needed a solution for Single Sign On authentication between multiple

  • 0

Some time ago we needed a solution for Single Sign On authentication between multiple web services. At least at that time we considered OpenID protocol too complicated and we were not convinced about the Ruby on Rails plugins for it. Therefore we designed a protocol of our own instead of implementing an OpenID provider and OpenID consumers.

I have two questions:

  1. Was it a bad thing not to create
    our own OpenID provider and setup
    our OpenID consumers accept only it?
    Public login or registration are not
    allowed and we wanted to keep
    authentication simple.

  2. Can you spot a crucial error or a vulnerability in the following design?

If you as a commune can approve this design, I will consider extracting this code into a Ruby on Rails plugin.

Please look at the flowchart and sequence diagram.

Details:

Authentication Provider (“AP”):

  • Central service which holds all data
    about the users.
  • Only one “AP” exists in this setup.
  • It could be possible to have multiple “AP”s, but that should not be relevant in this context.
  • “AP” knows each “S” beforehand.

Authentication Client (Service “S”):

  • There exists several internal and external web services.
  • Each service knows “AP” and its public key beforehand.

Actor (“A”):

  • The end user who authenticates
    herself with AP by a username and password
  • May request directly any URI of “S” or “AP” prior to her login

Connections between “A”, “S” and “AP” are secured by HTTPS.

Authentication logic described briefly:

These are a description for the graphical flowchart and sequence diagram which were linked at the top of this post.

1) Auth Provider “AP”

  • “AP” makes a server-to-server HTTP POST request to “S” to get a nonce.
  • “AP” generates an authentication token.
  • Authentication token is an XML entity which includes:
    • an expiration date (2 minutes from now),
    • the previously requested nonce (to prevent replay),
    • identifying name of “S” (token for Service_1 is not good for Service_2),
    • information about the end user.
  • Authentication token is encrypted with AES256 and the encryption key and initialization vector are signed by AP’s private RSA key.
  • Resulting strings (“data”, “key” and “iv”) are first Base64 encoded and then URL encoded to allow them be delivered in the URL query string.
  • End user “A” is HTTP-redirected to service “S” (HTTPS GET request).

2) Service “S”

  • Receives authentication token in URL parameters from user agent.
  • Decrypts authentication token with AP’s pre-shared public key.
  • Accepts one authentication token only once (token includes a nonce which is valid only once).
  • Checks that identifying name in authentication token corresponds to service’s name.
  • Checks that authentication token is not expired.

Remarks:

It is not a problem if somebody else can also decrypt the authentication token, because it contains no confidential information about the user. However, it is crucial that nobody else than AP is able to generate a valid authentication token. Therefore the RSA key pair is involved.

RSA private key is used only for signing the token, because it cannot encrypt data which is longer than the actual key length. Therefore AES is used for encryption.

Since the authentication token is delivered as an HTTP GET request, it will be stored e.g. in Apache’s log file. Using a disposable nonce and an expiration date should minimize the possibility of a replay attack. POST request would need an HTML page with a form which is submitted automatically by Javascript, which is why GET is used.

Service “S” generates a nonce only in a server-to-server API request. Therefore unauthenticated generation requests should not pose a DoS-vulnerability.

  • 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-16T09:05:13+00:00Added an answer on May 16, 2026 at 9:05 am

    You’re confusing authentication (“I am who I say I am”) and authorization/access control (“I am allowed to access this”). You can just implement OAuth, and then query a server over HTTPS with “is this OAuth identity allowed to access me?”. You don’t have to worry about replay attacks, since you’re using HTTPS.

    “Security is hard, so I’ll design my own.”

    Authentication token is encrypted with AES256 and the encryption key and initialization vector are signed by AP’s private RSA key.

    AES-256 and AES-192 have weak key schedules. But you’re not using it for confidentiality; you’re using it as some sort of “integrity” check. It doesn’t work: Attacker gets a “signed” authentication token. Attacker recovers the key and IV. Attacker encrypts a different authentication token with the same key and IV, and uses the same “signature”.

    What’s wrong with hashing it and signing the hash? Also note that if you’re going to use custom signing, you need to be careful about padding (IIRC PKCS-whatever adds at least 11 bytes).

    EDIT: And if you’re using a cipher where you should be using a hash/MAC, you really shouldn’t be designing a security protocol!

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

Sidebar

Related Questions

Some time ago I've read an article on CLR, where author showed that if
Some time ago I created this LAMP based web. At the time I wrote
Some time ago, I've got a new single board computer running Debian which will
quite some time ago i noticed that in Visual C++ 10 ADL fails when
Some time ago, I found a clever trick on stackoverflow that showed a way
Some time ago I came across a table that listed the generic equivalents for
Some time ago I started a project in which I needed to do the
Some time ago I saw a javascript library/development tool that takes several .js files
Some time ago, in my work I needed to protect some classes against other
Some time ago, I read that comparing version numbers can be done using the

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.