I'm trying to get the list of emails of users who installed my addon.
I'm using the onInstall trigger to get the email and push it to my database.
This is fine with individual installation (normal gmail or even admin who chooses to Individual Install)
But with Domain Install, onInstall event was not fired
So how can I track the Domain Installation?
We can use the LicenseNotification endpoint of the G Suite Marketplace API:
https://developers.google.com/gsuite/marketplace/v2/reference/licenseNotification/list
The result will be something like this:
{
"kind": "appsmarket#licenseNotificationList",
"notifications": [
{
"kind": "appsmarket#licenseNotification",
"id": "001566972002228000-000001",
"applicationId": "xxx",
"customerId": "test#gmail.com",
"timestamp": "1566972001590",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "1"
}
]
},
{
"kind": "appsmarket#licenseNotification",
"id": "001568364120883000-000001",
"applicationId": "xxx",
"customerId": "domainabc.com",
"timestamp": "1568364119585",
"provisions": [
{
"kind": "appsmarket#provisionNotification",
"editionId": "default_edition",
"seatCount": "-1"
}
]
},
...
],
"nextPageToken": "001569976724468000-000001"
}
Inside the notifications array, notice some object that has "seatCount": "-1"
Those are domain installations that we are looking for.
We just need to get the value inside "customerId": "domainabc.com",
Related
I'm testing Smooch Javascript SDK (https://docs.smooch.io/rest/#introduction) integrated to Whatsapp. I want to know if its possible to get user's phone number when I recieve a webhook request, the phone number is not in the request body.
// This is the request body I get
{
"trigger": "message:appUser",
"app": { "_id": "5d308957198c1f00104a3b88" },
"version": "v1.1",
"messages": [
{
"type": "text",
"text": "Hello",
"role": "appUser",
"received": 1563472958.747,
"name": "Kevin Arias",
"authorId": "2d4628bcb45b234a1ff",
"_id": "5d30b43ee223faa28f",
"source": {
"type": "whatsapp",
"integrationId": "5d308964a75fd5a457f",
"originalMessageId": "ABEGVzElE6JZEN_vQ92XFBiIrb4S",
"originalMessageTimestamp": 1563472958
}
}
],
"appUser": {
"_id": "2d4628b5cb45b234a1ff",
"conversationStarted": true,
"surname": "Arias",
"givenName": "Kevin",
"signedUpAt": "2019-07-18T15:00:45.883Z",
"properties": {}
},
"conversation": { "_id": "84860727bddac962a8b" }
}
Thanks,
If you enable the includeClient option on your Smooch webhook, there will be a client object included in the webhook payload, representing the source of the message. The WhatsApp username (typically the user's phone number) will be available under client.externalId
I want to create new alerts(High CPU,RAM) for all AppServicePlans in a given subscription. I could not find Powershell commands to create new alerts. Is there a way we can create these alerts for all appserviceplans with a single script? May be using ARM template?
Sorry for pasting a direct answer, but I cannot yet comment. You get the error because in the documentation for Add-AzMetricAlertruleV2 it states: "$act is the output of New-AzActionGroup cmdlet". Meaning you need to use for example:
$act = New-AzActionGroup -ActionGroupId "testActionGroup"
After that you need to add it in the parameter -ActionGroup $act for it to work.
If you look at Resource Explorer and navigate to a manually created (near-realtime) alert, you should see the "critera" object defined like below. Here is a full example of a resource that seems to be working. Create some variables for each of your values:
{
"type": "Microsoft.Insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "[variables('alertName')]",
"location": "global",
"dependsOn": [],
"tags": {
"[concat('hidden-link:', variables('applicationInsightsResourceId'))]": "Resource",
"[concat('hidden-link:', variables('webtestResourceId'))]": "Resource"
},
"properties": {
"description": "[concat('Alert for ', parameters('availibilityTestName'))]",
"severity": 4,
"enabled": true,
"scopes": [
"[variables('webtestResourceId')]",
"[variables('applicationInsightsResourceId')]"
],
"evaluationFrequency": "PT5M",
"windowSize": "PT15M",
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "[variables('webtestResourceId')]",
"componentId": "[variables('applicationInsightsResourceId')]",
"failedLocationCount": 3
},
"actions": [
{
"actionGroupId": "[resourceId('microsoft.insights/actiongroups', 'webhook')]",
"webHookProperties": {
// Some properties to send to webhook
}
}
]
}
}
I have a group that contains group, user and contact as members. I can fetch all of them in Admin UI and via PowerShell command Get-DistributionGroup -Identity 'myGroup'. Result looks like
[{
"Alias": "xxxxxx",
"Guid": "xxxxxx",
"Identity": "xxxxx",
"PrimarySmtpAddress": "xxxxxx",
"RecipientType": "UserMailbox",
"SamAccountName": "xxxxxxx",
"WindowsLiveID": "xxxxxxx"
},
{
"Alias": "yyyyyyyyy",
"Guid": "yyyyyyyyy",
"Identity": "yyyyyyyyy",
"PrimarySmtpAddress": "yyyyyyyyy",
"RecipientType": "MailUniversalSecurityGroup",
"SamAccountName": "yyyyyyyyy",
"WindowsLiveID": ""
},
{
"Alias": "zzzzzzzzzz",
"Guid": "zzzzzzzzzz",
"Identity": "zzzzzzzzzz",
"PrimarySmtpAddress": "zzzzzzzzzz",
"RecipientType": "MailContact",
"SamAccountName": "",
"WindowsLiveID": ""
}
]
Documentation states that GET /groups/{id}/members should return all group members, including users, contacts, and other groups as members.
I get only user and group tyro members back, not mail contact is returned.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [{
"#odata.type": "#microsoft.graph.user",
"id": "xxxxxx",
........
},
{
"#odata.type": "#microsoft.graph.group",
"id": "yyyyyyyyy",
........
}
]
}
Is this a bug in API or documentation?
Currently, the /v1.0 endpoint does not support Contacts. Since it isn't aware of Contacts, it isn't capable of returning them via /members.
The /beta endpoint has support for the microsoft.graph.orgContact entity. If you switch to this version, you should start seeing Contact members showing up in the results.
This is documented in the Known Issues but it's a little hidden. It isn't filed under Groups but instead under Contacts: Organization contacts available in only beta.
When making a call to the Microsoft Graph /sites?search endpoint, a root site facet is not returned.
Here is an example of the search:
https://graph.microsoft.com/v1.0/sites?search=fake Archive
It returns:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [{
"createdDateTime": "2017-11-04T18:52:44Z",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2017-11-14T23:21:51Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"displayName": "fake fake Archive"
}]
}
There is no root site facet. If I use the /site endpoint to access the site directly:
https://graph.microsoft.com/v1.0/sites/fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8
I get the response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
"createdDateTime": "2017-11-14T23:19:51.437Z",
"description": "",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2018-03-23T12:23:40Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"root": {},
"siteCollection": {
"hostname": "fakeau.sharepoint.com"
},
"displayName": "fake fake Archive"
}
Notice this now has a root site facet.
Is this a bug, or are there some situations in which the root site facet should not be shown in the /sites?search results?
The sites/search endpoint only returns a small subset of a site's properties:
id, name, description, createdDateTime,lastModifiedDateTime, and webUrl.
In order to retrieve the full metadata, you'll need to make subsequent requests to the /sites/{id} endpoint.
I'm using an OpenIDIdentityProvider with mappingMethod: claim to authenticate admin users in the Openshift admin console. I'm using the auth0 service to authenticate users. The admin users are defined in an ansible playbook on deployment, effectively making the admin users hard-coded.
Is it possible to completely manage all admin and developer users using the OpenIDIdentityProvider, a lookup mapping method and adding something like extraScopes: [roles] to pull through the additional authorization roles into the authentication request? That would enable me to completely manage users and roles separately from the ansible playbook. Next level bonus points for managing permissions on the authentication provider side.
The Openshift documentation is very light on details for authentication / authorization outside of the default mappingMethod: claim.
Below is my identity provider json file for the claim-based mapping method:
{
"items": [
{
"name": "auth0",
"challenge": false,
"login": true,
"mappingMethod": "claim",
"kind": "OpenIDIdentityProvider",
"clientID": "supersecretsauce",
"clientSecret": "extrasupersecretsauce",
"extraScopes": ["email", "profile"],
"claims": {
"id": [
"email"
],
"preferredUsername": [
"email"
],
"name": [
"name"
],
"email": [
"email"
]
},
"urls": {
"authorize": "https://fancypants.auth0.com/authorize",
"token": "https://fancypants.auth0.com/oauth/token",
"userInfo": "https://fancypants.auth0.com/userinfo"
}
}
]
}
To my simple mind the below would suffice for a working lookup-based mapping method with roles returned by the authentication provider:
{
"items": [
{
"name": "auth0",
"challenge": false,
"login": true,
"mappingMethod": "lookup",
"kind": "OpenIDIdentityProvider",
"clientID": "supersecretsauce",
"clientSecret": "extrasupersecretsauce",
"extraScopes": ["email", "profile", "roles"],
"claims": {
"id": [
"email"
],
"preferredUsername": [
"email"
],
"name": [
"name"
],
"email": [
"email"
],
"role": [
"roles"
]
},
"urls": {
"authorize": "https://fancypants.auth0.com/authorize",
"token": "https://fancypants.auth0.com/oauth/token",
"userInfo": "https://fancypants.auth0.com/userinfo"
}
}
]
}
An example of a functional role value would be cluster-admin.
OpenID can only be used for authentication. You are attempting to use it for both authentication and authorization. This is not possible as roles and bindings are managed by Openshift - they cannot be delegated to an external service.