Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow openid to run in stateless mode #117

Merged
merged 2 commits into from Jun 15, 2013
Merged

Allow openid to run in stateless mode #117

merged 2 commits into from Jun 15, 2013

Conversation

stevearc
Copy link
Contributor

If we pass 'storage=None' to an openid provider, it should run the
python openid consumer in stateless mode.

With the default options I was unable to run multiple wsgi workers and do openid auth because it was using a MemoryStore that was not shared among the workers. In order to run in stateless mode, you have to pass 'store=None' to the openid consumer, but the current OpenID provider was preventing that.

MemoryStore is still the default value for storage, but now if you explicitly pass 'storage=None' it will run in stateless mode.

If we pass 'storage=None' to an openid provider, it should run the
python openid consumer in stateless mode.
@mmerickel
Copy link
Collaborator

Interesting, I was unaware that python-openid had a stateless mode. What are the implications that I should be aware of here?

@mmerickel
Copy link
Collaborator

Also, if you don't mind, could you add some comments to the OpenID docs about this?

@stevearc
Copy link
Contributor Author

OpenID documents stateless mode here: http://openid.net/specs/openid-authentication-2_0.html#check_auth

python_openid only mentions stateless mode briefly, but from the docs:

If you have no safe place to store your data, construct your consumer
with None for the store, and it will operate only in stateless mode.
Stateless mode may be slower, put more load on the OpenID provider, and
trusts the provider to keep you safe from replay attacks.

Just to double check, did you want me to add the comments in this section?

@mmerickel
Copy link
Collaborator

Yeah that'd be a good spot to document the default MemoryStore and new None options.

@mmerickel
Copy link
Collaborator

I tested the stateless mode with google and yahoo and they both work fine so I've switched the default to stateless. Thank you for the PR!

@mmerickel mmerickel merged commit b7f765f into bbangert:master Jun 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants