Search Unity

WebGL taking login data from website it is embedded on?

Discussion in 'Web' started by amateurhr, Mar 1, 2019.

  1. amateurhr

    amateurhr

    Joined:
    Jun 28, 2013
    Posts:
    24
    We're starting to embed our WebGL build on our website. Since the user has already logged in via our website, we don't want them to have to sign-on within the WebGL build again. How do we go about getting the user web credentials over to the WebGL build?
     
  2. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
  3. TheRoccoB

    TheRoccoB

    Joined:
    Jun 29, 2017
    Posts:
    54
  4. bhupiister

    bhupiister

    Joined:
    Dec 13, 2019
    Posts:
    42
    I have a question pertaining to this. Suppose, a user has logged into the website via firebase authentication, now i need to pass token ID and other necessary stuff to unity webGL app for it to connect to firebase realtime database via restAPI.
    1) Now, is this the safe method to do so ? Sample URL to send is as below.
    https://<DATABASE_NAME>.firebaseio.com/users/ada/name.json?auth=<ID_TOKEN

    2) Is there any way to secure sending of this data to webGL?
     
  5. tonialatalo

    tonialatalo

    Joined:
    Apr 23, 2015
    Posts:
    60
    I think so. You are not really 'sending' anything, it's just all happening inside your application, on the local client side web page running in the user's browser.

    It's just local Javascript code that runs to call WASM code in the same app, basically the same as passing function parameters inside whatever program you write and run locally. Nothing is sent over any network or to any generic browser mechanism that anything outside your code could access.