Links

Social Login

Integration of Social Login - Google, Facebook and Apple
You'll need to import the javascript file in your website before starting from this link.
Plain Javascript
ES5+
Wordpress Plugin
const {facebook, google, apple} = WTN.socialLogin;
//Login Commands
facebook.login({
callback : function(value){
console.log(value)
}
});
google.login({
callback : function(value){
console.log(value)
}
});
apple.login({
callback : function(value){
console.log(value)
}
})
//Logout Commands
facebook.logout({
callback : function(value){
console.log(value)
}
});
google.logout({
callback : function(value){
console.log(value)
}
});
import {facebook, google, apple} from "webtonative/SocialLogin"
//Login Commands
facebook.login({
callback : function(value){
console.log(value)
}
});
google.login({
callback : function(value){
console.log(value)
}
});
apple.login({
callback : function(value){
console.log(value)
}
})
//Logout Commands
facebook.logout({
callback : function(value){
console.log(value)
}
});
google.logout({
callback : function(value){
console.log(value)
}
});
We have wordpress plugin for social login integration. Kindly find webtonative wordpress plugin from below link. https://wordpress.org/plugins/webtonative/
Callback parameter object
Facebook
Google
Apple
Login :-
{
"isSuccess":true,
"accessToken":"EXXXXXQ0iSXpNGVOCMVi000ZAnlslBJIHgXXX2dfkW4HtGLUAuuZCcESjfZXXXQZBZBV",
"userId":"1XXXXXXXXX519425",
"type":"fbLoginToken"
}
Login Error :-
{
"isSuccess":false,
"error":"Error message for logout",
"type":"fbLoginToken"
}
Logout :-
{
"isSuccess":true,
"message":"Logout Success",
"type":"fbLogOut"
}
Login :-
{
"isSuccess":true,
"idToken":"EXXXXXQ0iSXpNGVOCMVi000ZHgXXX2dfkW4HtGLUAuuXXXQZBZBV",
"type":"googleLoginToken"
}
Login Error :-
{
"isSuccess":false,
"error":"Error message for logout",
"type":"googleLoginToken"
}
Logout :-
{
"isSuccess":true,
"message":"Logout Success",
"type":"googleLogOut"
}
Logout Error:-
{
"isSuccess":false,
"error":"Error message for logout",
"type":"googleLogOut"
}
Login :-
{
"isSuccess":true,
"idToken":"********",
"code":"***********",
"type":"appleLoginToken",
*"firstName":"FirstNameHere",
*"lastName":"LastNameHere",
*"emailId":"[email protected]"
}
  • *Apple only returns the user's information the first time the user authorizes the app. Persist this information from your app; subsequent authorization requests won’t contain this information.
  • Once you have the user’s token(idToken), you can decode it using any general-purpose JWT library to retrieve user's information.
Wordpress plugin: We have wordpress plugin for social login integration. Kindly find webtonative wordpress plugin from below link. https://wordpress.org/plugins/webtonative/
Shopify plugin: We have shopify plugin for social login integration. https://apps.shopify.com/social-login-webtonative
Note:-
Apple Login is available only in iOS.