Skip to content

fixes "A Token was not found in the SecurityContext" error #1052

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

Merged
merged 1 commit into from
Feb 8, 2012
Merged

fixes "A Token was not found in the SecurityContext" error #1052

merged 1 commit into from
Feb 8, 2012

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Feb 1, 2012

Following Ryan's instructions outlined here:

https://github.com/symfony/symfony-docs/pull/1050#issuecomment-3753501

Submitting a pull request to fix the 2.0 branch first. 2.1 commit to follow as soon as this is merged in.

@stof
Copy link
Member

stof commented Feb 1, 2012

Why changing the formatting of the method there ? It seems like you did not change the logic at all except removing the early return

@bshaffer
Copy link
Contributor Author

bshaffer commented Feb 1, 2012

You are correct. The early return was causing the "Token not found in SecurityContext" error. Now, a 403 Response is set instead.

The change of formatting is because I indented everything to be inside the $request->headers->has('x-wsse') call.

@stof
Copy link
Member

stof commented Feb 1, 2012

I don't see how the early return could be the reason of the issue. Your code is strictly equivalent as nothing is done when there is no x-wsse header.

@bshaffer
Copy link
Contributor Author

bshaffer commented Feb 1, 2012

Now it sets and returns a 403 response if there is no x-wsse header. Before, it returned without setting a token or a response, which caused the error.

weaverryan added a commit that referenced this pull request Feb 8, 2012
…provider-cookbook-article-2.0

fixes "A Token was not found in the SecurityContext" error
@weaverryan weaverryan merged commit 2dc0980 into symfony:2.0 Feb 8, 2012
@weaverryan
Copy link
Member

Merged! Thanks!

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.

3 participants