Reputation: 541
Just wondering if there is a way to set up a Cloud Function to delete the entire Firebase Project.
Basically like a Self Destruct scenario.
Kind Regards.
Upvotes: 0
Views: 125
Reputation: 4069
As mentioned by @Frank, Resource Manager has method called Method: projects.delete
.
Here's a guide on using it on postman:
Web Application
. (If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen. The following procedure explains how to set up the Consent screen. You won't be prompted to configure the consent screen after you do it the first time.)Authorized redirect URIs
, click Add URI
. Go back to Postman, copy the Callback URL
from Postman as highlighted green on the image below and paste it on the Add URI textbox.OAuth client created
will pop up after creating Client ID as shown in the image.
DOWNLOAD JSON
. Securely save it somewhere safe.JSON
file you've saved. JSON
file should look like this:{
"web": {
"client_id": "xxxxxxx.apps.googleusercontent.com",
"project_id": "xxxxxxxxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "xxxxx-xxxxxxxxxxxx-xxxxxx",
"redirect_uris": [
"https://oauth.pstmn.io/v1/browser-callback"
]
}
}
Token Name
: Any name you want.Grant Type
: Authorization Code.Auth URL
: "auth_uri" from JSON file.Access Token URL
: "token_uri" from JSON file.Client ID
: "client_id" from JSON file.Client Secret
: "client_secret" from JSON file.Scope
: "https://www.googleapis.com/auth/cloud-platform" (For Reference: Authorization Scopes)Client Authentication
: Send as Basic Auth header.Get New Access Token
.Access Token
is now generated.Use Token
.DELETE
request.Upvotes: 1