- Installed Git
- Registered Facebook Android App
- Registered Google Sign-In App for Android
- Installed Android Studio
- Installed MobileFirst development environment
-
Clone this Git repository
-
From the above repository you will need three folders:
-
Social Login security check - The social login security check adapter.
-
HelloSocialUser Adapter - The JAX-RS resource adapter which protect with the scope socialLogin.
-
SocialLoginApp - The sample native android application.
-
- string.xml
<resources>
...
<string name="facebook_app_id">Put your Facebook app id here</string>
<string name="google_server_client_id">Put your Google web client id here</string>
...
</resources>
- Open the Android app SocialLoginApp in Android Studio.
- Edit the file string.xml, there you need supply the following:
-
Facebook App ID from Facebook Apps Console
-
Google Web Client ID from Google API Console.
-
For the Google SignIn you also need to get the google-services.json file.
-
- Ensure you have installed MobileFirst CLI
- Open your command line in the root of the Android project
- Register the app by typing
mfpdev app register
- IBM MobileFirst Platform gives you several options for deploying adapters.
- For each of the adapter above (Social Login security check and HelloSocialUser Adapter) do the following:
- Open command line in the root folder of the adapter.
- Run
mfpdev adapter build
- Run
mfpdev adapter deploy
- From your command line run
mfpdev server console
- this command will open your server console. - From the Adapters menu click on Social Login Adapter, and move to Security Checks tab.
- Here you will find place to add your google client id. This id will use the adapter to validate the Google account.
- If you need to use the social platform token later on, set the keep original token attribute to be true.
- You can now back to your Android Studio and run the app.
IBM MobileFirst Platform Foundation 8.0
Copyright 2016 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.