Closed flesage-000 closed 5 years ago
Hey @flesage-000 what the error means
There is no extension able to load the configuration for "knpu_oauth2_client"
Is that Symfony is reading your knpu_oauth2_client.yaml
file but nothing could process it. I believe this is happening because the bundle is not activated. Double check your config/bundles.php
file. You are on Symfony4, right?
Hey @larzuk91
Indeed i'm on Symfony 4.
I read something about that but i thought it was automatic for this version of Symfony !
I'll search on the web how to activate manually a bundle, thx !
Indeed i'm on Symfony 4.
Hmm, in that case, it should be enabled automatically. Look for the bundle inside config/bundles.php
If it's not for any reason, then just add it there and try again
Here is the bundles.php
return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], ];
and version is
const VERSION = '4.3.4';
downloaded/installed 3 days ago.
Well... @larzuk91
Now it's works, it seems that i don't understand an install question
The recipe for this package comes from the "contrib" repository, which is open to community contributions. Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/knpuniversity/oauth2-client-bundle/1.20
I thought by say "n" it install another version....
BTW, i can now see the discord login :D. Thanks a lot :)
Ah, yes, by default composer asks you if you want to install recipes coming from the contrib repository. It's just for security reasons, there could be a bad/hacky recipe.
I'm glad to know that you could fix your problem. I'm closing this issue but if you have more problems feel free to open another one
Hello,
I'trying to use oauth2-client-bundle for a project but i'm stuck at STEP 3 and got this error :
Here is my script (but similar to HP tutorial)
FacebookController.php `<?php namespace App\Controller;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route;
class FacebookController extends Controller { /**
@Route("/connect/facebook", name="connect_facebook_start") */ public function connectAction(ClientRegistry $clientRegistry) { // on Symfony 3.3 or lower, $clientRegistry = $this->get('knpu.oauth2.registry');
}
/**
@Route("/connect/facebook/check", name="connect_facebook_check") */ public function connectCheckAction(Request $request, ClientRegistry $clientRegistry) { // * if you want to authenticate* the user, then // leave this method blank and create a Guard authenticator // (read below)
} }`
knpu_oauth2_client.yaml `knpu_oauth2_client: clients:
will create service: "knpu.oauth2.client.discord"
- Initialy i use this to a OAuth2 Discord, so i duplicate for discord during the tutorial, but i have the same error for both - env var are set in .env file
I'm new to Symfony framework, so i assume that question is probably stupid :D.