403 Forbidden for Drive requests in Google Apps Marketplace App - google-apps-marketplace

Using a Google Apps Marketplace App installed from the Chrome Web Store with a full Drive scope works fine except when I unchecked the "Allow users to install Google Drive Apps" in Drive settings then I get this error with all Drive interactions:
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Forbidden",
"reason" : "forbidden"
} ],
"message" : "Forbidden"
}
This makes sense but reading this announcement I thought installing the App would be white listed:
"With today’s launch, Marketplace applications deployed by admins will be able to integrate with Google Drive for users who are provided with the app, even if this Admin Console setting is disabled. In essence, admins can now whitelist the Drive applications that their users can install."

Related

How to detect that a user installed an app with installType AVAILABLE

When an app is included in a policy with installType set to AVAILABLE (meaning the app is available to install) how can my EMM server detect that the user has installed the app?
There are two possible ways to check if an app is installed on the device, pub/sub or enterprises.devices.get. The device reports will list all apps installed on the device, not just the ones installed by the user. To pull app reports, you will need to include applicationReportsEnabled in your policy and wait for the device to sync with the server.
Example policy:
{
"applications": [
{
"packageName": "com.adobe.reader",
"installType": "AVAILABLE"
}
],
"statusReportingSettings" : {
"applicationReportsEnabled" : true
},
"debuggingFeaturesAllowed": true
}

Google Sheet to Laravel 8 Integration

I want to integrate google sheet with Laravel 8 without any third party tool or connector. I know its simple for many but i am not able to get through. Highly appreciate for your effort and answers!
Requirements:
Google OAuth Keys.
Google Service Account.
Enabling Google Drive API and Google Sheets API.
revolution/laravel-google-sheets Laravel package.
Steps:
Step 1: Installing revolution/laravel-google-sheets package
composer require revolution/laravel-google-sheets
# publish package files
php artisan vendor:publish --provider="PulkitJalan\Google\GoogleServiceProvider" --tag="config"
Step 2: Setup Google API OAuth Key
Navigate to Google Developers Console
Create a Google project or select already existed project.
Click Create credentials followed by OAuth client ID.
If necessary, Configure consent screen.
Set the type to Web Application.
Copy client_id and client_secret and set in .env:
GOOGLE_CLIENT_ID=XXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=XXXXXX-XXXXXXXXXXX-XXXXXXXXXXXXXXXX
Step 3: Setup Google Service Account
Navigate to Google Developers Console
Create a new Service account key from Credentials.
Give your service account a name.
Under Grant this service account access to project step click on Select a Role dropdown and choose Project from left side and Editor from right side as shown in this image
Click Continue then Done.
Edit the service account and go to Keys tab.
Create a new Key of type JSON, and copy the json file to your project storage directory and rename it as credentials.json -or any other name you like.
Add credentials.json file path to .env as following
GOOGLE_SERVICE_ENABLED=true
GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION=/home/user/code/project/storage/credentials.json
Step 4: Setup a Google Spreadsheet to integrate with
Create/Open a Google Spreadsheet file.
Give the sheet a name
Copy the ID of the document from file URL (e.g. https://docs.gogle.com/spreadsheets/d/{{SPREADSHEET_ID}}), see this image
Set the document id you copied in last step to .env
SPREADSHEET_ID=1kjtQBxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copy the Email of the recently created Service Account, see this image
Share the sheet with the Service Account email as Editor, see this image
Step 5: Enable required Google APIs
Navigate to Google Developers Console APIs Dashboard.
Click ENABLE API AND SERVICES.
Search for Google Drive API and Enable it.
Search for Google Sheets API and Enable it.
Step 6: Test it
use Revolution\Google\Sheets\Facades\Sheets;
// Add new sheet to the configured google spreadsheet
Sheets::spreadsheet(config('sheets.spreadsheet_id'))->addSheet('sheetTitle');
$rows = [
['1', '2', '3'],
['4', '5', '6'],
['7', '8', '9'],
];
// Append multiple rows at once
Sheets::sheet('sheetTitle')->append($rows);
see the package documentation for more examples.
{ "error": { "code": 403, "message": "The request is missing a valid API key.", "errors": [ { "message": "The request is missing a valid API key.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
Dont forget to add scopes!
[\Google\Service\Sheets::DRIVE, \Google\Service\Sheets::SPREADSHEETS]
to the google.php config file

403 Forbidden error POST - Google Cloud IoT

Trying to access Google Cloud IoT API - POST method -
Used this as reference as I am new to google cloud - https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/iot/api-client/manager
I have created a Spring Boot Application and an account with google.
Verified google credentials through CLI & a project ID has been linked with my project.
I have checked the permissions assigned to my account it was Owner/admin.
I have checked the quota allocated- haven't exceeded the amount.
I am trying to create a registry through the command line from my Spring Boot Application, but it is throwing the below error :
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
POST https://cloudiot.googleapis.com/v1/projects/null/locations/us-central1/registries
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Cloud IoT API has not been used in project xxxxxxxxxx90 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudiot.googleapis.com/overview?project=xxxxxxxxxx90 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com"
}
],
"message": "Cloud IoT API has not been used in project xxxxxxxxxx90 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudiot.googleapis.com/overview?project=xxxxxxxxxx90 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED"
}
I have enabled the Cloud IoT API, still the error is thrown.
Also, on the console log, I can see the following suggestion :
Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
I have created a service account & activated it through CLI as well. It isn't helping.
Any suggestion, fresh perspective is highly appreciated. Please do let me know if any other info needs to be added.
Thanks in advance.
Referring to the troubleshooting documentation of cloud IoT, we get PERMISSION_DENIED when the user or the application is not authorized to make requests.
The information provided by you and the error messages suggests issues in authentication of your application with Cloud IoT API. You need to authenticate using a service account and provide correct credentials in your application. (ie provide correct GOOGLE_APPLICATION_CREDENTIALS variable)
So, to use Cloud IoT you need to
First enable the Google Cloud IoT API.
Create credentials - service account to use the API for your
application, you can also grant roles to this service account
Generate a json key for this service account and use this key for
authentication.
For more details refer to this link.
Besides, you can also create a device registry directly from the gcloud command. link

Where can I enter my app specific password on appcenter.ms testflight integration?

With the new apple rule explained at https://developer.apple.com/support/account/authentication/:
In an effort to keep your account more secure, two-factor authentication will be required for Account Holders of a developer program to sign in to their Apple Developer account and Certificates, Identifiers & Profiles starting February 27, 2019. This extra layer of security for your Apple ID helps ensure that you're the only person who can access your account.
I am getting the following error when trying to publish my iOS app on the store through the CI at https://appcenter.ms :
{
"mandatory_update": false,
"release_notes": "feature/navigator profile (#467)",
"destinations": [
{
"id": "678b39eb-7040-43ca-b903-REDACTED",
"name": "App Store Connect Users",
"message": "Failed to publish to store. Error: App specific password is mandatory for 2fa enabled account in service connection id: 5b1a378c-d7bc-4492-5ad6-REDACTED",
"code": "app_specific_password_missing"
}
],
"code": "partially_succeeded",
"message": "Failed to publish to store. Error: App specific password is mandatory for 2fa enabled account in service connection id: 5b1a378c-d7bc-4492-5ad6-REDACTED"
}
I have looked everywhere online and crawled around the different menus without finding anything of interest.
Do you know where I should enter my app-specific password?
You can follow the instructions here: https://learn.microsoft.com/en-us/appcenter/distribution/stores/apple#adding-two-factor-authentication
Specifically:
Adding Two-factor authentication
If your Apple account has two-factor authentication enabled, App Store Connect requires an app-specific password as security. You can add an App-specific password to your account by navigating to Developer accounts in your Account settings.
Hover over an item in the Accounts list.
Click the three vertical dots on the right side of the list
Select Update app-specific password.
Generate an app-specific password using the Apple ID portal.
The name is for you to remember which service or app is using the app-specific password.
Copy the generated app-specific password and paste it into the dialogue.
Save by clicking Update.
This error is coming because of 2 factor authentication, you need to enter OTP for your apple app store ID.
Step 1: https://appcenter.ms/ open the app center click on distribute navigation link.
Step 2: Click on stores
Step 3: you can see the error message to reenter your Apple connect credentials for the verification, it will ask for OTP.
Now you can publish your app on app store.
I resolved this issue by navigating to https://appcenter.ms/settings/accounts.

Doesn't Exist/Access Permission Error when configuring Google Apps Marketplace SDK API

I am trying to configure the Google Apps Marketplace SDK and get the following error when clicking on the Configure Tab.
"The API "appsmarket-component.googleapis.com" doesn't exist or you don't have permission to access it"
However when I check for enabled services in the project it shows as enabled.
**$ gcloud service-management list --enabled
NAME TITLE
appsmarket-component.googleapis.com Google Apps Marketplace SDK**
Any pointers on how to resolve?
Note: I did setup the G-Suite account for the site just a couple of days back and so am still in the Trial period. Not sure if that has any impact on access to the API's?

Resources