Login using GIGYA without any social service provider

1.4k Views Asked by At

In my app users do not have an option use social services to register and login. They have their logins and passwords. How to perform login via GIGYA without using any social service using Android SDK? Documentation only explains login using social services and Gigya's UI.

2

There are 2 best solutions below

1
On

In order to perform login via Gigya without using social service you'd need to use the Gigya RAAS (registration as a service).

In android SDK documentation look for GSPluginFragment.

GSPluginFragment is a custom fragment that renders Gigya JS Plugins and integrates them seamlessly with the Gigya Android SDK. GSPluginFragment currently supports the following plugins, listed with their plugin name:

  • Comments - comments.commentsUI. Note: commenting is supported, but sharing the comment to social networks is not supported.
  • Ratings & Reviews - comments.commentsUI (Reviews mode is handles in the console) , comments.RatingUI for ratings plugin.
  • RaaS Screen-Sets - accounts.screenSet.
  • Share Bar - socialize.ShareBarUI. Please note: the share buttons that implement providers' own (native) buttons are not supported. These include Facebook's native Facebook Like button, Twitter's Tweet button, and more. For the full list please refer to the shareButtons parameter in socialize.showShareBarUI.

Now you can use the RAAS Screen-Sets.

HTH

0
On

I finally figure out how to use the gigya plugin fragment with the screensets.

private void gigyaLogin() {
    GSObject params = new GSObject();
    params.put("screenSet", "Default-RegistrationLogin");
    GSPluginFragment pluginFragment = GSPluginFragment.newInstance("accounts.screenSet", params);
    pluginFragment.setPluginListener(new GSPluginListener() {
        @Override
        public void onLoad(GSPluginFragment pluginFragment, GSObject event) {
            Log.d(TAG, "accounts.screenSet has finished loading");
        }

        @Override
        public void onEvent(GSPluginFragment pluginFragment, GSObject event) {
            Log.d(TAG, "Received plugin event from accounts.screenSet - " + event.getString("eventName", ""));
        }

        @Override
        public void onError(GSPluginFragment pluginFragment, GSObject error) {
            Log.d(TAG, "Error in accounts.ScreenSet - " + error.getInt("errorCode", -1));
            Log.d(TAG, "Error in accounts.ScreenSet - " + error.getString("errorMessage", "Error Message"));
        }
    });

    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.activity_login_layout, pluginFragment);
    transaction.commit();
}  

This will set the GSPluginFragment and show the login screen. You can create our own screen set that removes the social login and only has the gigya login.

Here is an example of what it will look like.

Gigya JSPlugin Default-RegistrationLogin