Google Web App User Info Access & Deployment - Apps Script Tutorial

Sdílet
Vložit
  • čas přidán 2. 06. 2022
  • Google Web App User Info Access & Deployment - Apps Script Tutorial
    #googleworkspace #javascript

Komentáře • 38

  • @lionelhue
    @lionelhue Před 2 lety +2

    Very instructive !

  • @matheussilva6202
    @matheussilva6202 Před 2 lety

    Very cool Brow.

  • @librairum2366
    @librairum2366 Před 11 měsíci

    thanks a lot.

  • @pgd724
    @pgd724 Před 2 lety

    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.

    • @getitdonetube
      @getitdonetube  Před 2 lety

      How exactly do you manage payments?

    • @pgd724
      @pgd724 Před 2 lety

      @@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

    • @getitdonetube
      @getitdonetube  Před 2 lety +5

      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.

  • @farukazam7250
    @farukazam7250 Před rokem

    Thanks

  • @abdullahquhtani4247
    @abdullahquhtani4247 Před 2 lety

    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?!

    • @getitdonetube
      @getitdonetube  Před 2 lety

      Yes.

    • @abdullahquhtani4247
      @abdullahquhtani4247 Před 2 lety +2

      @@getitdonetube In that case, I think you are generous and we deserve making a tutorial applying that scenario 😏

  • @DivitKalem
    @DivitKalem Před 2 lety +2

    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. 🤷‍♂️

    • @DivitKalem
      @DivitKalem Před 2 lety

      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

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      doGet function has no access to cookies or localStorage, so you should forget about doGet, do get should just load an empty page.

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      After that you'll need to use a single page application that will load everything with javascript.

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      so you'll need a function that will accept username/password and return a token if those are correct.

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      there is no need to store jwt in the database, the whole point of jwt is to not store tokens on the server.

  • @NancyLalluwadia
    @NancyLalluwadia Před 3 měsíci

    why this is asking delete spreadsheet permissions in the prompt ?

  • @laca6297
    @laca6297 Před 2 lety

    Thx for this tutorial.
    Is there any way to get the active user information, if I don't want to share the spreadsheet?

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      Only if you are both under the same Google Workspace.

    • @laca6297
      @laca6297 Před 2 lety

      @@getitdonetube thank you very much!

    • @laca6297
      @laca6297 Před 2 lety

      @@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?

    • @getitdonetube
      @getitdonetube  Před 2 lety +1

      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.

  • @user-zn9wq6uw5b
    @user-zn9wq6uw5b Před 5 dny

    When to share new video???

  • @zummon
    @zummon Před 11 měsíci

    Great tutorial! but is there a way to get an active user, that executes by me? 5:52

    • @getitdonetube
      @getitdonetube  Před 11 měsíci +3

      Only if you are a part of the same workspace-domain.

  • @avantiya
    @avantiya Před rokem

    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.