Skip to main content
Magento

Return to Answer

added 1212 characters in body
Source Link
Franck Garnier
  • 2.9k
  • 1
  • 18
  • 35

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: https://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

Extend or create your own API endpoint in order to manage FB / Twitter Login.

The native code for token generation is located here :

vendor/magento/module-integration/Model/CustomerTokenService.php:74

/**
 * {@inheritdoc}
 */
public function createCustomerAccessToken($username, $password)
{
 $this->validatorHelper->validate($username, $password);
 $this->getRequestThrottler()->throttle($username, RequestThrottler::USER_TYPE_CUSTOMER);
 try {
 $customerDataObject = $this->accountManagement->authenticate($username, $password);
 } catch (\Exception $e) {
 $this->getRequestThrottler()->logAuthenticationFailure($username, RequestThrottler::USER_TYPE_CUSTOMER);
 throw new AuthenticationException(
 __('You did not sign in correctly or your account is temporarily disabled.')
 );
 }
 $this->getRequestThrottler()->resetAuthenticationFailuresCount($username, RequestThrottler::USER_TYPE_CUSTOMER);
 return $this->tokenModelFactory->create()->createCustomerToken($customerDataObject->getId())->getToken();
}

Then you can modify the validation logic and the Magento customer ID retrieval in order to return a generated token.

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: https://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: https://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

Extend or create your own API endpoint in order to manage FB / Twitter Login.

The native code for token generation is located here :

vendor/magento/module-integration/Model/CustomerTokenService.php:74

/**
 * {@inheritdoc}
 */
public function createCustomerAccessToken($username, $password)
{
 $this->validatorHelper->validate($username, $password);
 $this->getRequestThrottler()->throttle($username, RequestThrottler::USER_TYPE_CUSTOMER);
 try {
 $customerDataObject = $this->accountManagement->authenticate($username, $password);
 } catch (\Exception $e) {
 $this->getRequestThrottler()->logAuthenticationFailure($username, RequestThrottler::USER_TYPE_CUSTOMER);
 throw new AuthenticationException(
 __('You did not sign in correctly or your account is temporarily disabled.')
 );
 }
 $this->getRequestThrottler()->resetAuthenticationFailuresCount($username, RequestThrottler::USER_TYPE_CUSTOMER);
 return $this->tokenModelFactory->create()->createCustomerToken($customerDataObject->getId())->getToken();
}

Then you can modify the validation logic and the Magento customer ID retrieval in order to return a generated token.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: http://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we https://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: http://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: https://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

Source Link
Franck Garnier
  • 2.9k
  • 1
  • 18
  • 35

I think you need to pass the Facebook auth token in order to validate your customer.

Extend the native token authentication with your logic to validate the Facebook token.

Usefull information: http://stackoverflow.com/questions/4623974/design-for-facebook-authentication-in-an-ios-app-that-also-accesses-a-secured-we

The same approach can works with Twitter.

default

AltStyle によって変換されたページ (->オリジナル) /