Esempio n. 1
0
        public GoogleAuth(ICloudAuthConfig config)
        {
            var webClientID = config.GetConfig <string>(GoogleAuthConfig.WEB_CLIENT_ID);

            Google.GoogleSignIn.Configuration = new Google.GoogleSignInConfiguration()
            {
                RequestIdToken = true,
                WebClientId    = webClientID
            };
            _inited = true;
        }
Esempio n. 2
0
        public static ICloudAuth Create(ICloudAuthConfig config)
        {
            if (config.IsNull())
            {
                return(null);
            }

            var service = config.GetConfig <CloudAuthType>(nameof(CloudService));

            if (auths.ContainsKey(service))
            {
                return(auths[service]);
            }

            switch (service)
            {
                #if GOOGLE_AUTH
            case CloudAuthType.GoogleSignIn:
            {
                return(auths[service] = new GoogleSignIn.GoogleAuth(config));
            }
                #endif

                #if FACEBOOK_AUTH
            case CloudAuthType.Facebook:
            {
                return(auths[service] = new Facebook.FacebookAuth(config));
            }
                #endif

                #if FIREBASE_AUTH
            case CloudAuthType.Firebase:
            {
                return(auths[service] = new Firebase.FirebaseCloudAuth(config));
            }
                #endif

                #if PLAYSERVICE_AUTH
            case CloudAuthType.GooglePlayService:
            {
                return(auths[service] = new GooglePlayService.GooglePlayServiceAuth(config));
            }
                #endif

            default:
            {
                "Service Unavailable".LogError();
                return(null);
            }
            }
        }