コード例 #1
0
        internal static FirebaseTokenVerifier CreateIDTokenVerifier(FirebaseApp app)
        {
            var projectId = app.GetProjectId();

            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to verify ID tokens.");
            }

            var keySource = new HttpPublicKeySource(
                IdTokenCertUrl, SystemClock.Default, app.Options.HttpClientFactory);
            var args = new FirebaseTokenVerifierArgs()
            {
                ProjectId       = projectId,
                ShortName       = "ID token",
                Operation       = "VerifyIdTokenAsync()",
                Url             = "https://firebase.google.com/docs/auth/admin/verify-id-tokens",
                Issuer          = "https://securetoken.google.com/",
                Clock           = SystemClock.Default,
                PublicKeySource = keySource,
            };

            return(new FirebaseTokenVerifier(args));
        }
コード例 #2
0
 private FirebaseMessaging(FirebaseApp app)
 {
     this.messagingClient = new FirebaseMessagingClient(
         app.Options.HttpClientFactory, app.Options.Credential, app.GetProjectId());
     this.instanceIdClient = new InstanceIdClient(
         app.Options.HttpClientFactory, app.Options.Credential);
 }
コード例 #3
0
        public static FirebaseUserManager Create(FirebaseApp app)
        {
            var args = new FirebaseUserManagerArgs
            {
                ClientFactory = app.Options.HttpClientFactory,
                Credential    = app.Options.Credential,
                ProjectId     = app.GetProjectId(),
            };

            return(new FirebaseUserManager(args));
        }
コード例 #4
0
        internal static FirebaseUserManager Create(FirebaseApp app)
        {
            var args = new Args
            {
                ClientFactory = app.Options.HttpClientFactory,
                Credential    = app.Options.Credential,
                ProjectId     = app.GetProjectId(),
                RetryOptions  = RetryOptions.Default,
            };

            return(new FirebaseUserManager(args));
        }
コード例 #5
0
        internal static ProviderConfigManager Create(FirebaseApp app, string tenantId = null)
        {
            var args = new Args
            {
                ClientFactory = app.Options.HttpClientFactory,
                Credential    = app.Options.Credential,
                ProjectId     = app.GetProjectId(),
                RetryOptions  = RetryOptions.Default,
                TenantId      = tenantId,
            };

            return(new ProviderConfigManager(args));
        }
コード例 #6
0
        internal static FirebaseUserManager Create(FirebaseApp app, string tenantId = null)
        {
            var args = new Args
            {
                ClientFactory = app.Options.HttpClientFactory,
                Credential    = app.Options.Credential,
                ProjectId     = app.GetProjectId(),
                TenantId      = tenantId,
                RetryOptions  = RetryOptions.Default,
                EmulatorHost  = Utils.EmulatorHostFromEnvironment,
            };

            return(new FirebaseUserManager(args));
        }
コード例 #7
0
        internal static TenantManager Create(FirebaseApp app)
        {
            var args = new Args
            {
                App           = app,
                ClientFactory = app.Options.HttpClientFactory,
                Credential    = app.Options.Credential,
                ProjectId     = app.GetProjectId(),
                EmulatorHost  = Utils.EmulatorHostFromEnvironment,
                RetryOptions  = RetryOptions.Default,
            };

            return(new TenantManager(args));
        }
コード例 #8
0
        internal static FirebaseTokenVerifier CreateSessionCookieVerifier(FirebaseApp app)
        {
            var projectId = app.GetProjectId();

            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to verify session cookies.");
            }

            var keySource = new HttpPublicKeySource(
                SessionCookieCertUrl, SystemClock.Default, app.Options.HttpClientFactory);

            return(CreateSessionCookieVerifier(projectId, keySource));
        }
コード例 #9
0
        internal static FirebaseTokenVerifier CreateIDTokenVerifier(FirebaseApp app)
        {
            var projectId = app.GetProjectId();

            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to verify ID tokens.");
            }

            var keySource = new HttpPublicKeySource(
                IdTokenCertUrl, SystemClock.Default, app.Options.HttpClientFactory);
            var args = FirebaseTokenVerifierArgs.ForIdTokens(projectId, keySource);

            return(new FirebaseTokenVerifier(args));
        }
コード例 #10
0
        internal static FirebaseUserManager Create(FirebaseApp app)
        {
            var projectId = app.GetProjectId();

            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to manage users.");
            }

            var args = new FirebaseUserManagerArgs
            {
                ClientFactory = new HttpClientFactory(),
                Credential    = app.Options.Credential,
                ProjectId     = projectId,
            };

            return(new FirebaseUserManager(args));
        }
コード例 #11
0
        internal static FirebaseTokenVerifier CreateIdTokenVerifier(
            FirebaseApp app, string tenantId = null)
        {
            var projectId = app.GetProjectId();

            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to verify ID tokens.");
            }

            var keySource = new HttpPublicKeySource(
                IdTokenCertUrl, SystemClock.Default, app.Options.HttpClientFactory);
            var args = CreateIdTokenVerifierArgs();

            args.ProjectId       = projectId;
            args.TenantId        = tenantId;
            args.PublicKeySource = keySource;
            args.IsEmulatorMode  = Utils.IsEmulatorModeFromEnvironment;
            return(new FirebaseTokenVerifier(args));
        }
コード例 #12
0
 private FirebaseMessaging(FirebaseApp app)
 {
     this.messagingClient = new FirebaseMessagingClient(
         new HttpClientFactory(), app.Options.Credential, app.GetProjectId());
 }