This project is made with Symfony 5.2 and PHP 7.4.
After cloning or downloading the repo, navigate to the project directory and follow the steps mentioned below.
- Install the backend dependencies:
composer install
. - Update database configuration, edit this line in
.env
file with your own configurationDATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
- Create database & tables with
php bin/console d:d:c
andphp bin/console d:s:u --force
- Start the server with Symfony:
symfony serve
Notice the two '%env(var)%'
calls? Add these anywhere in your .env
file.
These are the credentials for the OAuth provider. For Facebook, you'll get these by registering
your app on developers.facebook.com, for GitHub, you'll get these by registering
your app on Developer settings and for Google, on console.developers.google.
For Instagram is on developers.facebook.com
# .env
# ...
OAUTH_GITHUB_ID=github_id
OAUTH_GITHUB_SECRET=github_secret
OAUTH_FACEBOOK_ID=facebook_id
OAUTH_FACEBOOK_SECRET=facebook_secret
OAUTH_GOOGLE_CLIENT_ID=google_client_id
OAUTH_GOOGLE_CLIENT_SECRET=google_client_secret
OAUTH_INSTAGRAM_ID=instagram_id
OAUTH_INSTAGRAM_SECRET=instagram_secret
- For Facebook
{BASE_URL}/oauth/check/facebook
- For GitHub
{BASE_URL}/oauth/check/github
- For Google
{BASE_URL}/oauth/check/google
- For Instagram
{BASE_URL}/oauth/check/instagram
OAuth / Social Integration for Symfony: KnpUOAuth2ClientBundle