简体   繁体   中英

How can I create a tenant with social provider with firebase admin SDK?

I found in documentation that is only possible using the console. That is true? I think that should exists a way that I can do that via api, no?

Ref: https://cloud.google.com/identity-platform/docs/multi-tenancy-managing-tenants

How can I create a tenant with social provider with firebase admin SDK?. I found in documentation that is only possible using the console

The doc you refer to explains that:

Using the Admin SDK, you can manage tenants programmatically from a secure server environment instead of using the console. This includes the ability to create, list, get, modify, or delete tenants

and you can find the following example for creating a tenant. Note that by "secure server environment" the doc means a server you own on which you execute Admin SDK code or a Cloud Function.

admin.auth().tenantManager().createTenant({
  displayName: 'myTenant1',
  emailSignInConfig: {
    enabled: true,
    passwordRequired: false, // Email link sign-in enabled.
  },
  // TODO: Remove if you don't want to enable multi-factor authentication.
  multiFactorConfig: {
    state: 'ENABLED',
    factorIds: ['phone']
  },
  // TODO: Remove if you don't want to register test phone numbers for use
  // with multi-factor authentication.
  testPhoneNumbers: {
    '+16505551234': '145678',
    '+16505550000': '123456'
  },
})
.then((createdTenant) => {
  console.log(createdTenant.toJSON());
})
.catch((error) => {
  // Handle error.
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM