...
- Go to website https://developers.facebook.com/ and log into Facebook account.
- Click "My Apps" in right upper corner, then "Create APP".
- Fill in "Display Name" field. That name will be visible in Facebook Login form in web application. It is recommended to use combination of application and institution names, e.g. "dLibra - Our Digital Library".
- "Contact Email" field should contatain email of person responsible for facebook login configuration. By default it takes creator email.
- Create App ID.
- Set up Facebook Login.
- Then choose "WEB" option.
- Fill in "Site URL" field with your web service address, e.g. "https://our-digital-library.com" (without context path). Then confirm.
- Go to "Settings" -> "Basic".
- Fill in "App Domains" with domain name, eg. "our-digital-library.com".
- Fill in "Privacy Policy URL", eg."https://dingo.psnc.pl/en/privacy-policy/"), optionally "Terms of Service URL".
- Optionally upload "App Icon". It will be visible in Facebook Login form.
- Set application category. Based on facebook categories description, dLibra belongs to "Entertainment" category.
- Save changes.
- Copy "App ID" and "App Secret".
- Go to permissions panel "App Review" → "Permissions and Features" and set "Advanced Access" for email using "Request Advanced Access" button
- Click switch near "In development", then confirm with "Switch Mode". "In development" should change to "Live". In means that application was successfully activated.
Edit file "user-providers.xml" on "WEB-INF/conf" path web application directory. Uncomment FacebookUserInformationProvider node and replace CLIENT_ID and CLIENT_SECRET with previously copied values.
user-providers.xml<
pl.psnc.dlibra.web.comp.user.oauth.facebook.FacebookUserInformationProvider
>
<
configuration
>
<
loginPage
>${homepage}/dlibra/login</
loginPage
>
<
logoutPage
>${homepage}/dlibra/main?action=LogoutAction</
logoutPage
>
<
methodNameResourceKey
>LoginComponent.uip.facebook.name</
methodNameResourceKey
>
</
configuration
>
<
additionalConfiguration
>
<
clientId
>CLIENT_ID</
clientId
>
<
clientSecret
>CLIENT_SECRET</
clientSecret
>
</
additionalConfiguration
>
</
pl.psnc.dlibra.web.comp.user.oauth.facebook.FacebookUserInformationProvider
>
- Restart web application server. Then, it should be possible to log into web application with Facebook account.
...