How to get user details of Azure Notebook using extension? - javascript

I am trying to write an extension for the Azure notebook which will allow the user to submit their questions to my backend application(written in Flask).
So far my extension's javascript is able to get the .ipynb file details and cell number and send it to the backend application along with the user's question.
Now I want to send the user information also to the backend application so that I can associate the question to the respective user in my application's database.
I did a lot of google search but I am not able to find a proper way to get Azure notebook's user information in my extension's javascript and send it to the backend application.
Does anyone know what is the proper way to do that?

Yugendra. Based on my researching ,maybe you could call Microsoft Graph NoteBooks REST API in your extension js to get the user information of notebooks.
I test list notebook rest api in the https://developer.microsoft.com/en-us/graph/graph-explorer and the createdBy property shows the user information.

Related

How do I allow users to edit my Sheets file via my own Google Scripts Web App?

I'm quite new Google Scripts. I'm trying to create a web app through which users can log in (with their Gmail accounts) and modify a Google Sheet. Here's a screenshot of the registration page.
Initially, the user logs in via their existing Google account and this page is displayed. Upon clicking the button, what I want is for the script to add their submitted information and their current email to a Google Sheet. Once their info is in the Sheet, they only need to log in via Google to gain access to the system. However, when I try this with another account I get this error:
Is this a permissions problem? Or does Google Scripts not allow this kind of direct manipulation of files on my Drive? Here are my permissions settings for my web app:
Is this at all possible?
From your question, I could understand that the settings of your Web Apps is as follows.
Execute the app as: User accessing the web app
Who has access to the app: Anyone
For above Web Apps, you want to make users access to the Web Apps using each browser.
Confirmation points:
From above situation, please confirm the following points. At first, I think that when the Spreadsheet you want to put the values is in each user's Google Drive, no error occurs. So from your question, I thought that the Spreadsheet might be in your Google Drive.
Although I'm not sure about your whole script, if the Google Spreadsheet which is used in your script of Web Apps is in your Google Drive, it is required to shared the Google Spreadsheet with the user. Even when the script of Web Apps is the container-bound script of the Spreadsheet and getActiveSpreadsheet() is used, it is required to share the Spreadsheet with the user.
When you want to put the values to your Spreadsheet in your Google Drive when the user submitted the form, please share the Spreadsheet with the user as the writer.
When you want to only read the values from your Spreadsheet in your Google Drive when the user submitted the form, please share the Spreadsheet with the user as the viewer.
Also, you can publicly share. But I thought that this might not be the direction you expect.
Other method:
If you don't want to share the Spreadsheet with the user, how about the following workaround?
Deploy new Web Apps as following settings.
Execute the app as: Me
Who has access to the app: Anyone, even anonymous
In this case, you can also make user access to this Web Apps using a key as the query parameter.
When Who has access to the app: Anyone is used, it is required to share the script of new Web Apps with the user. So I proposed to use Anyone, even anonymous for this situation.
When the form is submitted, the values are put to your Google Spreadsheet using this new Web Apps.
In this case, new Web Apps is used as the wrapper API for putting the values to Spreadsheet.
References:
Web Apps
Taking advantage of Web Apps with Google Apps Script

Get List of Applications For a Specific Microsoft Azure Tenant

As you know currently a user needs to access https://myapps.microsoft.com/ then select an organization and then a list of applications is displayed.
I'm trying to re-build that portal in a single JS page. The user already authenticates with Azure to reach this JS page, and my target is to make a call to microsoft and retrieve the list of applications available for this specific user.
All I found in microsoft docs is how to retrieve data and access token for a specific application using the client secret and details about this application. But in my case I don't have an application all I have is a tenant id.
Is this feasible? keep in mind I can only use JS not nodejs or angular etc.
You can use below graph api to list all of the apps which the specific user be assigned a role.
https://graph.microsoft.com/beta/users/{userId}/appRoleAssignments
The resourceDisplayName is the name of the app shown in the page you provided and the resourceId is the objectId of the app(service principal) in azure.
By the way, it seems the page you provided doesn't show all of the apps which the specific user be assigned a role. I'm not sure if there is bug in that page, but the graph api I provided shows all of the apps for the specific(the user is assigned a role in the app).
Hope it helps~

Getting feedback from a JavaScript application without a registering for a centralized service

I created a Chrome extension which is just HTML/CSS/JavaScript. When the user clicks on a button, I have it send a message to me. But the problem is I don't want to include any API keys or server information where the app can POST to as it can be used for abuse if someone was to extract this information from my Chrome app. Is there a method of getting a response from a web app with a public service where anyone can post to? I was thinking pastebin, but even that requires an API key.
You could ask the user to create their own key. For example, many GitHub extensions require an API key to make requests to the GitHub API, so what they do is they send you to a GitHub settings page where you can create a personal API key.

Automatically access my Google Analytics and display chart publicly on my website

I'm having some difficulties in figuring out the best way to do this:
Using Google Analytics API, or similar Google API, I would like to track a user's activity from the moment they access the page until they reach an end page, which is gonna show them back some charts with THEIR activity on my website. (Nothing too detailed, just how long they've been on each page, how many session etc.)
So far, I've managed follow the Embed API example to access THE USER's Google Analytics account and draw a chart by asking for permission, however when it comes to showing data from MY account I just can't seem to figure it out.
I want my website to automatically use my account (or service account) and draw some charts from my google analytics data and show it to every user.
What would be the best way to approach this? I've read something about access tokens but I don't know if that's the solution. Moreover, my hosting is a shared host and I don't think it allows installing Python Modules like in this example.
Cheers for the help!
If you want to show the user your data, you will have to perform the authentication on the server side. There is no way around this. It is after all, your account's data that they are accessing.
If you are unable to install Google's client library, you need to:
Get an access token using cURL (see how here)
Use that access token to perform server side authentication for the user (see how here)
The user should now be able to access your site without logging in, and see YOUR data.

Facebook Login JS vs PHP SDK and how to keep track of users locally

A very simple question which I've seen kinda answers to.
Can you do a facebook login with PHP to authenticate a user and grab information?
Why then is there a JS version?
I just don't understand the difference between the two above options.
My web app will need to gleen the users email address as there will be a mailing list component to signing up for our service.
How do you manage this local information and uniquely identify the user each time they log in from facebook? Do you store their facebook ID?
Thanks
1- Yes - https://developers.facebook.com/docs/reference/php/
2- So you can do it on the client side.
You can get user's email address if you have appropriate permissions.
Yes you store their facebook id and associate users with it.
They both do the same thing, just on different sides: on the server or on the client.
If your authentication process relies heavily on server interaction and you have your server side code ready, use the PHP SDK. It provids you with methods to get the ID from the user. This will be unique so you can store them.
If you want to manage an application flow, say the user needs to give your website certain permissions in order to view something, it can be easy done with the Javascript SDK.

Categories

Resources