You can set up social sign-in for your MyCity portal to make it easier for your users to sign in and manage their accounts. As long as you enable it and set it up, users can log in using Facebook, Google, LinkedIn, and Microsoft; these platforms are most likely to host pages for businesses or community groups.
Enable social sign in
You can enable social sign-in from your Site Management settings but first, ensure that you're working in your MyCity site using the site picker in the top left corner of the main menu.
- From the main menu, go to More > Site Management > your MyCity site > Settings.
- Select Log in.
- Ensure your Sign in/Registration process pages are correct before enabling social sign-in. After setting up social sign-in, changing your Login page can interfere with your site, so be careful if you need to change your Login page in Site Management.
- Under Social sign in, switch the Enable setting to Yes.
- You'll need to set up each social platform you want to use. You can set up Facebook, Google, LinkedIn, and Microsoft.
To set up Facebook social sign-in:
- Open a new window in your browser and go to the Facebook for Developers site.
- Select Get Started to register, then follow the steps to create an app. You may already have an app for embedding a Facebook feed on your site, but you'll need to create a new one for social sign-in. Keep in mind that users may see your app details, so use a meaningful Display Name (such as MyCity sign-in) and Contact Email.
- You'll be asked to select an app type. Choosing Consumer or Business will give you access to the Facebook Login product.
- Add the Facebook Login product to your app. When it asks for your Site URL, enter your MyCity website domain (e.g., mycity.opencities.com).
- Go to the Facebook Login product settings and enter the URL of your login page for your MyCity site (e.g., https://mycity.opencities.com/mycity/Log-in) in the Valid OAuth Redirect URIs field.
- Go to the app settings and copy your App ID and App secret.
- Go back to your OpenCities admin and from the main menu, go to More > Site Management > your MyCity site > Settings > Log in.
- Under your Facebook Social sign in settings, paste the App ID and App Secret into the matching fields.
- Select Save Settings and Save. Make sure you test your Facebook social sign-in.
If you need help with this, check out the Facebook for developers support page.
To set up social sign-in with Google:
- Open a new window in your browser and go to the Google API console.
- Create a project, enable Google People API in your Google project, and follow Google’s instructions to set up OAuth 2.0.
- When creating the OAuth client ID, choose Web application as the Application type.
- In the Authorized redirect URIs field, enter the URL for the login page of your MyCity site (e.g., http://mycity.opencities.com/mycity/Log-in).
- Copy your client ID and client secret.
- Go back to your OpenCities admin and from the main menu, go to More > Site Management > your MyCity site > Settings > Log in.
- Under the Google Social sign in settings, paste your client ID and client secret into the matching fields.
- Click Save Settings, then Save.
It might take some time for Google to approve your credentials. Give it a few minutes before you test the sign-in.
If you need help with any of this, check out the Google API Console Help.
To set up social sign-in with LinkedIn:
- Open a new window in your browser and go to Linkedin for developers.
- Follow Linkedin’s instructions to authenticate with OAuth 2.0.
- When Linkedin asks for your Authorized Redirect URIs, enter the URL for the login page of your MyCity site (e.g. http://mycity.opencities.com/mycity/Log-in).
- Copy your Client ID and Client Secret.
- Go back to your OpenCities admin and from the main menu, go to More > Site Management > your MyCity site > Settings > Log in.
- Under the LinkedIn Social sign in settings, paste your Client ID and Client secret into the matching fields.
- Click Save Settings, then Save. Make sure you test your LinkedIn social sign-in.
If you need help with any of this, check out the Linkedin Developer Support.
Microsoft
To set up social sign-in with Microsoft:
- Open a new window and go to the Microsoft Application Registration Portal.
- Follow Microsoft’s instructions to register an app. Your app’s Platform should be Web.
- When Microsoft asks for your Redirect URLs, enter the URL for the log in page of your MyCity site (e.g. http://mycity.opencities.com/mycity/Log-in).
- When you set Microsoft Graph Permissions, choose the Delegated Permissions ‘User.Read’ and ‘User.ReadBasic.All’.
- Copy the Application Id into a notepad.
- In the Application Secrets section, select Generate New Password. Copy the password into a notepad.
- Go back to your OpenCities admin and from the main menu, go to More > Site Management > your MyCity site > Settings > Log in.
- Under the Microsoft Social sign-in settings, paste your Application Id into the Client Id field, and your Application Secret password into the Client secret field.
If you need help with any of this, check out the Microsoft Azure documentation.
Test your social sign in
To test your social sign-in is working, go to your MyCity site and attempt to log in through each platform that you have connected. If the MyCity login page takes you to the relevant social media login page or a page to create an account, then they're working properly.
Remember that Google can take time to approve the credentials, so you'll need to wait a few minutes before testing the sign-in.