Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome extension login best practices

I'm creating a Chrome extension popup and need login. For now, I will make my own authentication with a username and password, but what are best practices within an extension?

Here are my thoughts:

  • I will make the login against a remote server using a post.
  • Get a token back which I will keep in local storage for an amount of time.
  • The popup should also have a register inside it

Is it good to keep it all inside the extension? This is where I want my users to be, and not in some website to register and so on.

The change from login to "home page" or the registration page, should this be done with messaging?

like image 986
Rasmus Christensen Avatar asked Aug 27 '11 20:08

Rasmus Christensen


People also ask

Do you have to be signed into Chrome to use extensions?

You now seem to need sign in to a Google account to install any extensions/add-ons from Chrome Web Store. But you can still install an extension without logging in to a Google account by doing the following: Find the ID for the extension you want to install. You can see it in the URL on in Chrome Web Store.

Can Chrome extensions Read saved passwords?

But do you know how browser extensions work? Some browser extensions require access to almost everything your browser sees. They can see sites visited, keystrokes, and even passwords.


1 Answers

You should always use OAuth 2.0 for authentication within extensions. Never pass the username/password because an attacker can simply steal such information.

An example from Chromium regarding OAuth in extensions is Tutorial: OAuth.

Additionally, there's an experimental API available for OAuth 2.0, which is supposed to make the whole process a little easier. There's a comprehensive blog post, OAuth 2.0 from Chrome Extensions.

like image 195
Mohamed Mansour Avatar answered Oct 16 '22 06:10

Mohamed Mansour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!