-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[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
Conversation
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.
I'm a bit worried about |
// 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); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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 screenAuth description
- Description provided in auth request screen within BlockstackButton label text
- Text of the login button on login screenAvatars
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 thecrypto
module in client.Replaces #10462
Closes #10462