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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:28:14+00:00 2026-05-13T05:28:14+00:00

I’m building Pylons-based web application with RESTful API, which currently lacks any authentication. So

  • 0

I’m building Pylons-based web application with RESTful API, which currently lacks any authentication. So I’m going to implement that and in order to avoid all the trouble and caution with storing user passwords, I’d like to use OpenID for authentication. What would be the best way to do this? Are these two things compatible? Are there existing REST APIs that use OpenID that I can take inspiration from?

  • 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-13T05:28:14+00:00Added an answer on May 13, 2026 at 5:28 am

    I’ve now spent some time researching the options and would like to summarize the findings.
    First, a little bit more context — I develop and control both the service and API consumer. Consumer is Flash-based app that is served from the same host the API is now and is supposed to be used in browser. No third party clients in sight yet.

    So the question can be divided in two parts,

    • how do I do the OpenID authentication via API
    • how do I maintain the “authenticated” state in subsequent requests

    For first part, OpenID authentication almost always includes interactive steps. During the authentication process there will most likely be a step where user is in OpenID provider’s web page, signing in and pressing some “I agree” button. So API cannot and shouldn’t handle this transparently (no “tell me your OpenID provider and password and I’ll do the rest”). Best it can do is pass forth and back HTTP links that client has to open and follow instructions.

    Maintaining “authenticated” state

    REST APIs should be stateless, each request should include all the information needed to handle it, right? It wouldn’t make any sense to authenticate against OpenID provider for each request, so some kind of session is neccessary. Some of the options for communicating session key (or “access token” or username/password) are:

    • HTTPS + BASIC authentication (“Authorization: Basic …” header in each request)
    • Signing requests Amazon-style (“Authorization: AWS … ” header in each request)
    • OAuth: acquire Access Token, include that and a bunch of other parameters in each request
    • Cookie that stores session key (“Cookie: … ” header in each request)
    • Signed cookie that stores session information in the cookie itself

    There’s just one API consumer right now, so I chose to go for simplest thing that could possibly work — cookies. They are super-easy to use in Pylons, with help of Beaker. They also “just work” in the Flash app — since it runs inside browser, browser will include relevant cookies in the requests that Flash app makes — the app doesn’t need to be changed at all with respect to that. Here’s one StackOverflow question that also advocates using cookies: RESTful authentication for web applications

    Beaker also has nice feature of cookie-only sessions where all session data is contained in the cookie itself. I guess this is about as stateless as it gets. There is no session store on server. Cookies are signed and optionally encrypted to avoid tampering with them in client side. The drawback is that cookie gets a bit bigger, since it now needs to store more than just session key. By removing some stuff I didn’t really need in the session (leftovers from OpenID authentication) I got the cookie size down to about 200 bytes.

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

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For your requirements the easiest way is to create a… May 13, 2026 at 8:00 pm
  • Editorial Team
    Editorial Team added an answer libssh2_session_set_blocking(session, 0); char buffer[0x4000]; rc = libssh2_channel_read( channel, buffer, sizeof(buffer)… May 13, 2026 at 8:00 pm
  • Editorial Team
    Editorial Team added an answer The way you would do it for regular buttons, I… May 13, 2026 at 8:00 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.