Skip to content

Do not pass object without __toString for token generator #6574

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

Closed
wants to merge 1 commit into from

Conversation

phan7om
Copy link

@phan7om phan7om commented May 16, 2016

May be it's good for those who implements that receipt from cookbook to prevent them from this trap.

May be it's good for those who implements that receipt from cookbook to prevent them from this trap.
@linaori
Copy link
Contributor

linaori commented May 20, 2016

It's clearly documented in the signature of the object though: https://github.com/symfony/security-core/blob/master/Authentication/Token/UsernamePasswordToken.php#L29

I don't think a comment like this would help much though, maybe it would be better to add it to a ..note: or something? @xabbuh this would be a nice case to 'annotate' code as I mentioned some time ago 😉

@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

@phan7om
Copy link
Author

phan7om commented May 27, 2016

I think it's better to place it in custom_password_authenticator article because there are some other cautions present. And for those who started using this guide from that page would be easer to avoid pitfalls.

@wouterj
Copy link
Member

wouterj commented Jun 24, 2016

I'm sorry, but I'm 👎 on this change. For a couple of reasons:

  • This applies to the user object in the complete security systems. It's more usefull to talk about such things in the articles where we create user objects or user providers.
  • If you create a security user, you should implement UserInterface and the problem is fixed
  • I've a code branch locally that removes the double functionality of tokens (both before and after the user is authenticated). This means users always are objects implementing UserInterface and we no longer have this strange thing.

@javiereguiluz
Copy link
Member

@phan7om we recently revamped Symfony Docs so we can no longer merge your original pull request. Besides, I agree with the reviewers comments, so I've created #6837 and #6838 taking this pull request as inspiration. Thanks!

@xabbuh
Copy link
Member

xabbuh commented Aug 3, 2016

Thank you for starting this @phan7om. I am closing here in favour of #6837 and #6838.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants