Skip to content

Added the documentation for the success/failure handlers #6556

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 6 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #4258. I've used 2.7 as the base branch because Fabien said these handlers where not very useful before 2.6.

It's still a rough draft. I need help to complete the last section. Thanks!


Symfony defines an event called ``security.interactive_login`` that lets you
customize the behavior of the login process. The main differences between this
event and the login handlers are XXXX and YYYY.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not ready...

@linaori
Copy link
Contributor

linaori commented May 12, 2016

Related: #6493

@javiereguiluz
Copy link
Member Author

I've completed the last section with the excellent explanations suggested by @stof. This is now ready for the final review. Thanks!

How to Customize the Success and Failure Login Handlers
=======================================================

After the users successfully log in in your application, they are redirected to
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, log in to your application

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

@javiereguiluz
Copy link
Member Author

I've added all the config formats.


.. code-block:: xml

<!-- src/AppBundle/Resources/config/services.xml -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/config/services.xml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Damn copy+paste :( Fixed.

@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

👍

{
public function onAuthenticationSuccess(Request $request, TokenInterface $token)
{
// do something...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just use // ... here

@wouterj
Copy link
Member

wouterj commented May 21, 2016

The coolest feature about success/failure handlers is missing here: If your handler contains a setOptions() method, custom success handler options will be passed. For the success handler, if a setProviderKey() method exists, it'll be called to set the provider key.

As these values differ per firewall, it's impossible to get them in any other way. And this is precisely why these handlers aren't very usefull in <2.6.

Refs https://github.com/symfony/security/blob/2.6/Http/Authentication/CustomAuthenticationSuccessHandler.php#L34-L39

Can you please update the article to explain these methods?

@wouterj
Copy link
Member

wouterj commented May 21, 2016

@javiereguiluz
Copy link
Member Author

I'm closing this because it's clear that I'm trying to explain something that I don't fully understand. I'm sorry.

@javiereguiluz javiereguiluz deleted the fix_4258 branch May 24, 2018 16:04
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.

6 participants