So in case there are many users using the same sheet, is it possible to save each user log or save his email next to edits he does on that sheet?!
@getitdonetube2 жыл бұрын
Yes.
@abdullahquhtani42472 жыл бұрын
@@getitdonetube In that case, I think you are generous and we deserve making a tutorial applying that scenario 😏
@高吉米-p1b6 ай бұрын
When to share new video???
@zummon Жыл бұрын
Great tutorial! but is there a way to get an active user, that executes by me? 5:52
@getitdonetube Жыл бұрын
Only if you are a part of the same workspace-domain.
@pgd7242 жыл бұрын
Great information. Would be helpful to understand how to manage users where an app is launched as a paid service and you need to manage subscriptions.
@getitdonetube2 жыл бұрын
How exactly do you manage payments?
@pgd7242 жыл бұрын
@@getitdonetube If you have a paid add-on with monthly or annual subscription, you'd need to know when to collect payment for each subscriber
@getitdonetube2 жыл бұрын
You wouldn't do any of that in Google Sheets. You'd store all that externally in a database, like mysql and handle all the charges and everything else on your own server. From google sheets side you would simply run a UrlFetchApp request with that user's email to your server and have your server confirm that this user is still allowed to use the app.
@DivitKalem2 жыл бұрын
Awesome as always. Thanks. 👏👏👏 I'm using this method in a web app for authentication, but it's tedious to share the spreadsheet with all of users and ask for their permission. So instead I'm trying to find a way to implement one of classic auth methods like jwt token. But so far I could not. The biggest problem is that Google blocks redirects. 🤷♂️
@DivitKalem2 жыл бұрын
My goal is as follows: doGet() function returns the login.html file. If there is no token in localStorage or sessionStorage or cookies does nothing. Keeps the login page. The users enter their username and password and then submit the form. doPost() function verifies if the username and password are correct. If correct returns index.html page with a jwt token saves the token to database a js function saves the token to localStorage If wrong returns login.html with a error code. If there is a token a js function sends the token to a server side function If the token matches a user's token in the database redirects to index.html page. The user is logged in. Else keeps login.html page
@getitdonetube2 жыл бұрын
doGet function has no access to cookies or localStorage, so you should forget about doGet, do get should just load an empty page.
@getitdonetube2 жыл бұрын
After that you'll need to use a single page application that will load everything with javascript.
@getitdonetube2 жыл бұрын
so you'll need a function that will accept username/password and return a token if those are correct.
@getitdonetube2 жыл бұрын
there is no need to store jwt in the database, the whole point of jwt is to not store tokens on the server.
@NancyLalluwadia9 ай бұрын
why this is asking delete spreadsheet permissions in the prompt ?
@laca62972 жыл бұрын
Thx for this tutorial. Is there any way to get the active user information, if I don't want to share the spreadsheet?
@getitdonetube2 жыл бұрын
Only if you are both under the same Google Workspace.
@laca62972 жыл бұрын
@@getitdonetube thank you very much!
@laca62972 жыл бұрын
@@getitdonetube It might work if I write a separate web app to identify the user (where I can read the active user); and based on the e-mail address, I call the main app by passing a parameter?
@getitdonetube2 жыл бұрын
Yes, theoretically, you can create second Web App as API, pass fetch request via backend with user's email included. It will be pretty complicated to make one though.
@avantiya2 жыл бұрын
Can we change the code of Google sheet editor add-on, such that using same code we can access it through web app too. Right now, we can not access the sheets editor add-on through mobile browser of Android sheets app, but if we can embed the same code in website then we might access it through the mobile browser. I have my database having columns(yes it is in sheet, I don't know MySQL, please prepare a series for beginners of MySQL) email address, Spreadsheet ID, Spreadsheet name, validity date etc. When one runs add-on, I am verifying the user, sheet id and date. I think, if I can acces his email then using my database, I can give him options of sheet names, in which he/she wants to work, and then I might load the editor add-on menu in div or Li elements, which access the selected sheet instead of SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name) of editor add-on.