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

Update middleware.rst #164

Merged
merged 2 commits into from Apr 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/en/middleware.rst
Expand Up @@ -139,6 +139,28 @@ setup::
You no longer have to change any existing typehints, and can start using
authorization policies anywhere you have access to your user.

If you also use the Authentication plugin make sure that implement both.::
davidspeijer marked this conversation as resolved.
Show resolved Hide resolved

use Authorization\IdentityInterface as AuthorizationIdentity;
use Authentication\IdentityInterface as AuthenticationIdentity;

class User extends Entity implements AuthorizationIdentity, AuthenticationIdentity
{
...

/**
* Authentication\IdentityInterface method
*
* @return string
*/
public function getIdentifier()
{
return $this->id;
}

...
}

Ensuring Authorization is Applied
---------------------------------

Expand Down