Skip to content

Using the Credentials API #7150

Closed
Closed

Description

@mintbridge
  • Electron version: 1.3.5
  • Operating system: Mac

Im trying to use the credentials api (https://w3c.github.io/webappsec-credential-management/) so that i dont need to store username and password for an external service. Trying to call navigator.credentials.get() results in a Could not establish connection to the credential manager. error in a rejected promise. Looking through the code and credentials spec, I think it's because file:// isn't treated as a secure context.

I tried to register file:// as a secure scheme with

const { webFrame } = require('electron');
webFrame.registerURLSchemeAsSecure('file');

but that didn't work either.

So the question is, should this work in a file:// context and if so how to make it?

Activity

  1. deepak1556 commented on Sep 10, 2016

    @deepak1556
    Member

    Haven't used credentials api just read the spec, but chromium doesn't throw the error with file scheme. So its a bug in Electron Electron has to integrate password_manager component for the api to work. Aside from it, why would you want to use the api with file scheme, it doesn't have any origin concept and there are algorithms in the spec that rely on origin which would definitely cause you problem.

  2. jkingyens commented on Oct 7, 2016

    @jkingyens

    I wonder if its possible to give electron apps a kind of "pseudo origin" like a bundle identifier that gives them proper sandboxing. This would allow the credential API to plug into the credential storage manager of the OS. For example, keychain on OSX. Does this make sense?

  3. piotr-cz commented on May 30, 2017

    @piotr-cz

    happening in v1.4.4 (via Nightmare) when accessing http://localhost:8000 with code

    navigator.credentials.store(new PasswordCredential({
    // ...
    }));
  4. codebytere commented on Aug 30, 2019

    @codebytere
    Member

    Hi, while we appreciate this enhancement request it's not something that our team will be able to implement in the near future.

    If you'd like to make a PR for this request we would welcome that but in the meantime I'm going to go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions