use of com.amazonaws.mobile.auth.core.IdentityManager in project aws-sdk-android by aws-amplify.
the class OAuth2Utils method registerUserSignInProvidersWithPermissions.
/**
* Register the SignInProvider with their permissions
* supplied by the user.
*/
private void registerUserSignInProvidersWithPermissions() {
Log.d(TAG, "Using the SignInProviderConfig supplied by the user.");
final IdentityManager identityManager = IdentityManager.getDefaultIdentityManager();
for (final SignInProviderConfig config : signInProviderConfig) {
identityManager.addSignInProvider((Class<? extends SignInProvider>) config.getSignInProviderClass());
if (config.getProviderPermissions() != null) {
if (FacebookSignInProvider.class.isInstance(config.getSignInProviderClass())) {
FacebookSignInProvider.setPermissions(config.getProviderPermissions());
}
if (GoogleSignInProvider.class.isInstance(config.getSignInProviderClass())) {
GoogleSignInProvider.setPermissions(config.getProviderPermissions());
}
}
}
}
Aggregations