What is the best way to identify a machine / user in Google Chrome Extention?

I have a web application and is complemented by a chrome extension for it that sends data in the background to the web application. Now I want to send this data to the appropriate user account in the web application. Which method should be used? How do I handle authentication?

I was wondering if there is a way to identify the machine ID or something that I can register when the user logs in, but I see no way to get the machine ID.

Please suggest a better way to implement this.

Thank!

+3
source share
3 answers

, .

var macId = null;
chrome.storage.local.get('machine-id', function(item){
  var storedMacId = item['machine-id'];
  if(!storedMacId) {
    storedMacId = Math.random().toString(36).slice(2);
    chrome.storage.local.set({'machine-id':storedMacId});
  }
  macId = storedMacId;
});

, macId . . , ( Chrome, google ).

, .

!

+3

, API. - API . , . api, . URL-, API.

0

OAuth is currently the standard authentication method for web application APIs these days.

0
source

Source: https://habr.com/ru/post/1793241/


All Articles