Skip to content

[NEW] Blockstack as decentralized auth provider #12047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 83 commits into from
Sep 20, 2018
Merged

Conversation

rodrigok
Copy link
Member

@rodrigok rodrigok commented Sep 13, 2018

Electron / Desktop

This implementation doesn't work with our electron/desktop yet

Admin / Service Settings

A number of admin settings are added for the package behaviour and auth request details.

  • Enable
  • Generate username - If true will generate the username automatically from the user's profile when no username came from blockstack, otherwise user will see the username selection screen
  • Auth description - Description provided in auth request screen within Blockstack
  • Button label text - Text of the login button on login screen

Avatars

Avatars are loaded directly from Blockstack.org when user logins for the first time and saved as a local avatar, users can update the avatars from the profile page where we added the blockstack as one of the avatar source of suggestions.

The no email thing

Because Blockstack accounts do not contain an email address, yet Rocket.Chat fundamentally requires one, I've found a workaround by populating the email field with their ID @ blockstack.email.

Added dependencies

Rocket.Chat required meteor-node-stubs package to support the crypto module in client.

Replaces #10462
Closes #10462

image

localhost_3000_admin_blockstack laptop with hidpi screen

geekgonecrazy and others added 30 commits December 7, 2017 20:46
WIP: Have added stub classes and login elements without functionality

BREAKING CHANGE: No other login or auth provider will function on this branch from now on.
Redirects and request generation are triggered, but response not yet handled.
Now successfully processing auth request and getting user data back to server, just need to wire up
user login methods.
Can log users in, but not out. Not much catching or logging.
# Conflicts:
#	README.md
#	package-lock.json
#	package.json
Allows deploying to production, will write manifest attributes on request from settings and
environment.
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 00:33 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 01:28 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 18:08 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 18:10 Inactive
@rodrigok rodrigok changed the title [WIP] Blockstack as decentralized auth provider for Rocket.Chat [NEW] Blockstack as decentralized auth provider Sep 14, 2018
@rodrigok rodrigok added this to the 0.70.0 milestone Sep 14, 2018
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 18:57 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 14, 2018 19:01 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 17, 2018 12:46 Inactive
@sampaiodiego
Copy link
Member

sampaiodiego commented Sep 17, 2018

I'm a bit worried about meteor-node-stubs, see meteor/node-stubs#6

// Create and get created user to make a couple more mods before returning
logger.info(`Creating user for Blockstack ID ${ id }`);
userId = Accounts.insertUserDoc({}, newUser);
user = Meteor.users.findOne(userId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this find's result is not being used

const name = RocketChat.settings.get('Site_Name');
const startUrl = Meteor.absoluteUrl();
const description = RocketChat.settings.get('Blockstack_Auth_Description');
const iconUrl = Meteor.absoluteUrl('assets/favicon_192');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have a proper way to get assets' addresses.. we do differently on push notifications

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sampaiodiego can you change this?

import './settings.js';
import './loginHandler.js';

Meteor.isDevelopment = (process.env.ROOT_URL.indexOf('localhost') !== -1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not being used by this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, this is set by default.. is there a reason to override the default value/logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't, was a trash from the original PR

@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 18, 2018 17:37 Inactive
@rodrigok rodrigok temporarily deployed to rocket-chat-pr-12047 September 18, 2018 17:38 Inactive
@sampaiodiego sampaiodiego merged commit 5824bd7 into develop Sep 20, 2018
@sampaiodiego sampaiodiego deleted the blockstack branch September 20, 2018 16:48
This was referenced Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants