-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Documentation for the OAuth2 integration #1113
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
Conversation
Hello guys, any update on this? |
@chalasr would you mind to take a look if it looks good to you? I never used FOSOAuth :/ |
# http://symfony.com/doc/current/book/security.html | ||
security: | ||
encoders: | ||
FOS\UserBundle\Model\UserInterface: bcrypt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto
mode should be used isn't it? https://symfony.com/blog/new-in-symfony-4-3-native-password-encoder
resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml" | ||
``` | ||
|
||
## Create clients |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Create clients | |
## Create Clients |
|
||
## Create clients | ||
|
||
Add this class to `AppBundle/Command/CreateOAuthClientCommand.php` to generate oauth clients via console: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this class to `AppBundle/Command/CreateOAuthClientCommand.php` to generate oauth clients via console: | |
Add this class to `api/src/Command/CreateOAuthClientCommand.php` to generate Oauth clients via console: |
Other paths and namespaces must be updated accordingly.
<?php | ||
// AppBundle/Entity/RefreshToken.php | ||
|
||
namespace AppBundle\Entity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace AppBundle\Entity; | |
namespace App\Entity; |
Same everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As hinted by review comments, code samples looks based on outdated Symfony standards (directory structure, naming conventions, configuration ...), actually that's because the upstream (FOSOAuthServerBunde) documentation is outdated.
Even worse, the bundle is not ready for Symfony 5.
So I'm wondering... is it worth the hassle?
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class CreateOAuthClientCommand extends ContainerAwareCommand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bundle already provides a similar command out of the box, isn't it?
@chalasr You are right, the FOSOAuthServerBunde is not ready for Symfony 5. I actually ended up using trikoder/oauth2-bundle instead of FOSOAuthServerBunde for OAuth in our project. I can try to write documentation for integrating trikoder/oauth2-bundle instead of FOSOAuthServerBunde with api platform. trikoder/oauth2-bundle is already compatible with Symfony 5. Let me know if that is something that would be useful. |
A deprecated version of API Platform. Feel free to reopen it in our last version. |
I am creating a new pull request to merge the documentation done by @iCodr8 in the original Pull Request #182 Since he doesn't seem to have the original pull request branch and this documentation is pending for a long time. This refers to issue #180.
I have also made changes as suggested by @dunglas in that original pull request. Can someone please review this and let me know if this looks correct?