Magento 2 : Social Login via Rest ApiGet Token Authentication For Customer Logged With Facebook & Twitter : Magento 2Use SOAP and REST API TogetherGet All customers from Magento using rest APIREST api call for Guest userRest API strategy for mobile app in Magento 2How to use Magento 2 API?Rest API: Get order id by customer emailSign Up with Customer Image attribute REST API : Magento 2REST API Access Token IssuesMagento2 Push notification for IOS and AndroidMagento 2 Customer Rest Api Token error for some users [weird problem]
What was the first Intel x86 processor with "Base + Index * Scale + Displacement" addressing mode?
Was there a shared-world project before "Thieves World"?
What is the difference between `command a[bc]d` and `command `ab,cd`
Pass By Reference VS Pass by Value
Why was Germany not as successful as other Europeans in establishing overseas colonies?
How much cash can I safely carry into the USA and avoid civil forfeiture?
Repelling Blast: Must targets always be pushed back?
Who is the Umpire in this picture?
What's the polite way to say "I need to urinate"?
How come there are so many candidates for the 2020 Democratic party presidential nomination?
How would one muzzle a full grown polar bear in the 13th century?
Does Gita support doctrine of eternal samsara?
Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?
Why do games have consumables?
Why do Computer Science majors learn Calculus?
Sci fi novel series with instant travel between planets through gates. A river runs through the gates
Please, smoke with good manners
How to have a sharp product image?
What does KSP mean?
Is the 5 MB static resource size limit 5,242,880 bytes or 5,000,000 bytes?
How to get a plain text file version of a CP/M .BAS (M-BASIC) program?
Why other Westeros houses don't use wildfire?
What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?
With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?
Magento 2 : Social Login via Rest Api
Get Token Authentication For Customer Logged With Facebook & Twitter : Magento 2Use SOAP and REST API TogetherGet All customers from Magento using rest APIREST api call for Guest userRest API strategy for mobile app in Magento 2How to use Magento 2 API?Rest API: Get order id by customer emailSign Up with Customer Image attribute REST API : Magento 2REST API Access Token IssuesMagento2 Push notification for IOS and AndroidMagento 2 Customer Rest Api Token error for some users [weird problem]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to create a user account using social network via the API.
I have created via native iOS application
that hooks into magento 2 store API. However, I can not find a way to create an account using any of social extensions.
They add buttons however they do not expose any functionality over rest API for creating accounts or login.
magento2 api customer-account webapi
add a comment |
I need to create a user account using social network via the API.
I have created via native iOS application
that hooks into magento 2 store API. However, I can not find a way to create an account using any of social extensions.
They add buttons however they do not expose any functionality over rest API for creating accounts or login.
magento2 api customer-account webapi
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Do you have an Idean, how to get the token after login with social ? review thishttps://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04
add a comment |
I need to create a user account using social network via the API.
I have created via native iOS application
that hooks into magento 2 store API. However, I can not find a way to create an account using any of social extensions.
They add buttons however they do not expose any functionality over rest API for creating accounts or login.
magento2 api customer-account webapi
I need to create a user account using social network via the API.
I have created via native iOS application
that hooks into magento 2 store API. However, I can not find a way to create an account using any of social extensions.
They add buttons however they do not expose any functionality over rest API for creating accounts or login.
magento2 api customer-account webapi
magento2 api customer-account webapi
edited Jan 31 '18 at 12:49
Teja Bhagavan Kollepara
2,99242050
2,99242050
asked Feb 10 '17 at 0:00
Aaron BedwardAaron Bedward
63
63
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Do you have an Idean, how to get the token after login with social ? review thishttps://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04
add a comment |
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Do you have an Idean, how to get the token after login with social ? review thishttps://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Do you have an Idean, how to get the token after login with social ? review this
https://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
Do you have an Idean, how to get the token after login with social ? review this
https://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04
add a comment |
1 Answer
1
active
oldest
votes
At first create a custom rest api with below route. you can follow this link:
https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ to create custom res api.
<!-- ws: social login -->
<route url="/V1/customrestapi/login" method="POST">
<service class="PackageNameCustomRestApiApiSocialloginInterface" method="socialLogin"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
Then in the socialLogin method pass the social data as array.Here you can put your logic as shown below code.
/**
* Copyright 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace PackageNameCustomRestApiModel;
use PackageNameCustomRestApiApiSocialloginInterface;
/**
* Defines the implementaiton class of the calculator service contract.
*/
class Sociallogin implements SocialloginInterface
{
protected $_storeManager;
protected $_scopeConfig;
protected $_objectManager;
protected $_customerFactory;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCustomerModelCustomerFactory $customerFactory
)
$this->_storeManager = $storeManager;
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
$this->_customerFactory = $customerFactory;
/**
* Check Login.
*
* @api
* @param string[] $data The array of strings to socialLogin.
* @return $this
*/
public function socialLogin($data)
// json array for data should be "data":"email":"test@gmail.com","password":"password","type":"fb/gp","socialId":"","socialToken":"","firstName":"","lastName":"","dob":"","gender":""
// type is used to identify social media facebook or google+
if($data['type']=='fb')
// facbook login logic goes here
elseif($data['type']=='gp')
// google plus login logic goes here
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f159102%2fmagento-2-social-login-via-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
At first create a custom rest api with below route. you can follow this link:
https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ to create custom res api.
<!-- ws: social login -->
<route url="/V1/customrestapi/login" method="POST">
<service class="PackageNameCustomRestApiApiSocialloginInterface" method="socialLogin"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
Then in the socialLogin method pass the social data as array.Here you can put your logic as shown below code.
/**
* Copyright 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace PackageNameCustomRestApiModel;
use PackageNameCustomRestApiApiSocialloginInterface;
/**
* Defines the implementaiton class of the calculator service contract.
*/
class Sociallogin implements SocialloginInterface
{
protected $_storeManager;
protected $_scopeConfig;
protected $_objectManager;
protected $_customerFactory;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCustomerModelCustomerFactory $customerFactory
)
$this->_storeManager = $storeManager;
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
$this->_customerFactory = $customerFactory;
/**
* Check Login.
*
* @api
* @param string[] $data The array of strings to socialLogin.
* @return $this
*/
public function socialLogin($data)
// json array for data should be "data":"email":"test@gmail.com","password":"password","type":"fb/gp","socialId":"","socialToken":"","firstName":"","lastName":"","dob":"","gender":""
// type is used to identify social media facebook or google+
if($data['type']=='fb')
// facbook login logic goes here
elseif($data['type']=='gp')
// google plus login logic goes here
add a comment |
At first create a custom rest api with below route. you can follow this link:
https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ to create custom res api.
<!-- ws: social login -->
<route url="/V1/customrestapi/login" method="POST">
<service class="PackageNameCustomRestApiApiSocialloginInterface" method="socialLogin"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
Then in the socialLogin method pass the social data as array.Here you can put your logic as shown below code.
/**
* Copyright 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace PackageNameCustomRestApiModel;
use PackageNameCustomRestApiApiSocialloginInterface;
/**
* Defines the implementaiton class of the calculator service contract.
*/
class Sociallogin implements SocialloginInterface
{
protected $_storeManager;
protected $_scopeConfig;
protected $_objectManager;
protected $_customerFactory;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCustomerModelCustomerFactory $customerFactory
)
$this->_storeManager = $storeManager;
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
$this->_customerFactory = $customerFactory;
/**
* Check Login.
*
* @api
* @param string[] $data The array of strings to socialLogin.
* @return $this
*/
public function socialLogin($data)
// json array for data should be "data":"email":"test@gmail.com","password":"password","type":"fb/gp","socialId":"","socialToken":"","firstName":"","lastName":"","dob":"","gender":""
// type is used to identify social media facebook or google+
if($data['type']=='fb')
// facbook login logic goes here
elseif($data['type']=='gp')
// google plus login logic goes here
add a comment |
At first create a custom rest api with below route. you can follow this link:
https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ to create custom res api.
<!-- ws: social login -->
<route url="/V1/customrestapi/login" method="POST">
<service class="PackageNameCustomRestApiApiSocialloginInterface" method="socialLogin"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
Then in the socialLogin method pass the social data as array.Here you can put your logic as shown below code.
/**
* Copyright 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace PackageNameCustomRestApiModel;
use PackageNameCustomRestApiApiSocialloginInterface;
/**
* Defines the implementaiton class of the calculator service contract.
*/
class Sociallogin implements SocialloginInterface
{
protected $_storeManager;
protected $_scopeConfig;
protected $_objectManager;
protected $_customerFactory;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCustomerModelCustomerFactory $customerFactory
)
$this->_storeManager = $storeManager;
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
$this->_customerFactory = $customerFactory;
/**
* Check Login.
*
* @api
* @param string[] $data The array of strings to socialLogin.
* @return $this
*/
public function socialLogin($data)
// json array for data should be "data":"email":"test@gmail.com","password":"password","type":"fb/gp","socialId":"","socialToken":"","firstName":"","lastName":"","dob":"","gender":""
// type is used to identify social media facebook or google+
if($data['type']=='fb')
// facbook login logic goes here
elseif($data['type']=='gp')
// google plus login logic goes here
At first create a custom rest api with below route. you can follow this link:
https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ to create custom res api.
<!-- ws: social login -->
<route url="/V1/customrestapi/login" method="POST">
<service class="PackageNameCustomRestApiApiSocialloginInterface" method="socialLogin"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
Then in the socialLogin method pass the social data as array.Here you can put your logic as shown below code.
/**
* Copyright 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace PackageNameCustomRestApiModel;
use PackageNameCustomRestApiApiSocialloginInterface;
/**
* Defines the implementaiton class of the calculator service contract.
*/
class Sociallogin implements SocialloginInterface
{
protected $_storeManager;
protected $_scopeConfig;
protected $_objectManager;
protected $_customerFactory;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkObjectManagerInterface $objectManager,
MagentoCustomerModelCustomerFactory $customerFactory
)
$this->_storeManager = $storeManager;
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
$this->_customerFactory = $customerFactory;
/**
* Check Login.
*
* @api
* @param string[] $data The array of strings to socialLogin.
* @return $this
*/
public function socialLogin($data)
// json array for data should be "data":"email":"test@gmail.com","password":"password","type":"fb/gp","socialId":"","socialToken":"","firstName":"","lastName":"","dob":"","gender":""
// type is used to identify social media facebook or google+
if($data['type']=='fb')
// facbook login logic goes here
elseif($data['type']=='gp')
// google plus login logic goes here
edited Feb 10 '17 at 9:57
answered Feb 10 '17 at 7:51
Prasanta HatuiPrasanta Hatui
1,4601514
1,4601514
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f159102%2fmagento-2-social-login-via-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you reached for the solution?
– Jsparo30
Apr 26 '17 at 14:56
Still looking - Mostly likely will need to code the full implementation
– Aaron Bedward
Apr 27 '17 at 16:53
Do you have an Idean, how to get the token after login with social ? review this
https://magento.stackexchange.com/questions/175480/get-token-authentication-for-customer-logged-with-facebook-twitter-magento-2
– Jsparo30
May 24 '17 at 8:43
You can follow this guide: cloudways.com/blog/add-social-login-in-magento-2 to add Social login to your site.
– Say Truth
Jul 7 '17 at 2:04