do something with all this new power! // e.g.Simple to use, but jam-packed with time-saving features, 2Do is the productivity tool that meets your need for speed. the exact class depends on which provider you're using /** \League\OAuth2\Client\Provider\FacebookUser $user */ $user = $client-> fetchUser() ** if you want to *authenticate* the user, then // leave this method blank and create a Guard authenticator // (read below) /** \KnpU\OAuth2ClientBundle\Client\Provider\FacebookClient $client */ $client = $clientRegistry-> getClient( 'facebook_main') ** * After going to Facebook, you're redirected back here * because this is the "redirect_route" you configured * in config/packages/knpu_oauth2_client.yaml * * name="connect_facebook_check") */ public function connectCheckAction( Request $request, ClientRegistry $clientRegistry) 'public_profile', 'email' // the scopes you want to access > getClient( 'facebook_main') // key used in config/packages/knpu_oauth2_client.yaml on Symfony 3.3 or lower, $clientRegistry = $this->get('') // will redirect to Facebook! return $clientRegistry ** * Link to this controller to start the "connect" process * * name="connect_facebook_start") */ public function connectAction( ClientRegistry $clientRegistry) Use Symfony\ Component\ Routing\ Annotation\ Route Ĭlass FacebookController extends AbstractController Use Symfony\ Component\ HttpFoundation\ Request Use Symfony\ Bundle\ FrameworkBundle\ Controller\ AbstractController Use League\ OAuth2\ Client\ Provider\ Exception\ IdentityProviderException Use KnpU\ OAuth2ClientBundle\ Client\ ClientRegistry Step 2) Configure the ProviderĪwesome! Now, you'll configure your provider. Otherwise, consider creating a generic client yourself. Step 1) Download the Client LibraryĬhoose the one you want from this list and install itĬomposer require luchianenco/oauth2-amazonĬomposer require patrickbussmann/oauth2-appleĬomposer require stevenmaguire/oauth2-bitbucketĬomposer require stevenmaguire/oauth2-boxĬomposer require buddy-works/oauth2-clientĬomposer require schoolrunner/oauth2-cleverĬomposer require seinopsys/oauth2-deviantartĬomposer require chrishemmings/oauth2-digitaloceanĬomposer require wohali/oauth2-discord-newĬomposer require crewlabs/oauth2-dribbbleĬomposer require stevenmaguire/oauth2-dropboxĬomposer require chrishemmings/oauth2-drupalĬomposer require stevenmaguire/oauth2-elanceĬomposer require evelabs/oauth2-eveonlineĬomposer require stevenmaguire/oauth2-eventbriteĬomposer require stevenmaguire/oauth2-foursquareĬomposer require jerryhopper/oauth2-fusionauthĬomposer require surfoo/oauth2-geocachingĬomposer require alexmasterov/oauth2-headhunterĬomposer require stevenmaguire/oauth2-herokuĬomposer require stevenmaguire/oauth2-keycloakĬomposer require stevenmaguire/oauth2-microsoftĬomposer require mollie/oauth2-mollie-phpĬomposer require aego/oauth2-odnoklassnikiĬomposer require stevenmaguire/oauth2-paypalĬomposer require stevenmaguire/oauth2-salesforceĬomposer require adam-paterson/oauth2-slackĬomposer require qdequippe/oauth2-symfony-connectĬomposer require edwin-luijten/oauth2-stravaĬomposer require adam-paterson/oauth2-stripeĬomposer require depotwarehouse/oauth2-twitchĬomposer require vertisan/oauth2-twitch-helixĬomposer require stevenmaguire/oauth2-uberĬomposer require hughbertd/oauth2-unsplashĬomposer require stevenmaguire/oauth2-zendeskĭon't see a provider you need in this list? Please, check the full list of third-party provider (GitHub, Facebook, etc) that you want to talk to. You'll need to configure one client for each OAuth2 server Older apps, enable it in your AppKernel class.Īwesome! Now, you'll want to configure a client. If you're using Symfony Flex, the bundle will be automatically enabled. Install the bundle library via Composer byĬomposer require knpuniversity/oauth2-client-bundle If you don't like it, come back! Installation Not sure which to use? If you need OAuth (social) authentication & registration, try The knpuniversity/oauth2-client-bundle, takes more work to setup, but gives you Including social authentication and registration (called "connect"). Great question! Generally speaking, hwi/oauth-bundle gives you more features out-of-the-box, You might be wondering "why are there two popular OAuth bundles?". In addition to this bundle, another OAuth bundle exists for Symfony: hwi/oauth-bundle. This bundle integrates with league/oauth2-client. (or Guard Authenticator for legacy applications) Doing OAuth2 authentication with Symfony Custom Authenticator.Fetching access keys via OAuth2 to be used with an API."Connect with Facebook" type of functionality.OAuth / Social Integration for Symfony: KnpUOAuth2ClientBundleĮasily integrate with an OAuth2 server (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |