oceanprotocol-archive / bounties

🎣 Bounties for Ocean Protocol
Apache License 2.0
11 stars 0 forks source link

End-to-end User Authentication for React and Express.js using passport.js #10

Closed Kwinten-C closed 5 years ago

Kwinten-C commented 5 years ago

End-to-end User Authentication for React and Express.js using passport.js

We are working on a dApp using React (for frontend) and Express.js (for node.js server). We are using material UI theme for React. We want you to help us implement user authentication module (end-to-end) using passport.js jwt-strategy.

We already have some implementation of the app. See components diagram below.

mm-sketch_bounty1hld

How can you help?

Implement a simple user authentication system that keeps track of all registered users and allows access control to certain parts of the application. User Login is necessary to implement a personal credit or token score and potentially later personal consumer data or wiki edit logging. A User Login system will also provide a small but useful barrier to prevent malevolent attacks on the curation ecosystem.

This system is compromised of the following parts:

We are assuming that by looking at the project structure you will have a pretty good idea where the implementation code should go. But, in case of any doubts we will help you.

Link to Github Repo

What needs to be done?

User interface

Make a javascript based pop up panel that must be called whenever the user performs an access-required action. The interface will have a register and a login option. In the register option, there must be a form with three required fields: unique user ID, password, and email (for password recovery). When the user ID already exists in the database, the user should receive an error message. For the login part, the user will be prompted to provide user ID and password.

If the user ID already exists in the databse during register, an informative error message must be displayed. If the user gives in the wrong password /ID combination, a proper error message must be displayed. The user must have the option to request for a password reset when forgotten by email.

Passport.js integration

Implement passport.js using JWT strategy. Connect the passport to the express.js back end. More documentation can be found here: http://www.passportjs.org/packages/passport-jwt/

User Datastore

Create a scalable datastore for application users within Mongo DB. Each user entry should have the following fields in collection users. Sample is shown below -

<email>: {
    username: 
    password:
    createdOn: <user creation date in UTC format>
    lastModifiedOn: <password last updated on in UTC format>
    lastLoginOn: <when did user last login in UTC format>
    }

Test coverage:

Related tests should be written using mocha for express.js and React UI tests using Jest

We are very happy when

Note > All PRs for this implementation goes in this repo: https://github.com/oceanprotocol/musicmap/

Seen this problem before?

Any help solving this is welcome. Feel free to leave any comments and help someone else to solve it. We might airdrop tokens to someone even if not directly completing bounty.

Questions & Reviews

Pull requests will be reviewed by one of the maintainers or long-term contributors. In case of any additional questions feel free to ask in this thread and we will do our best to add the missing info :)

Things to know

The bounty lifecycle process including payout will be managed using Gitcoin. We'll be responding to your questions here, but for discussion and clarification we recommend to join also our Gitter channel where our tech community is accessible. In order to see the PROCN balance in your wallet you'll need to reference the related token contract with address 0xf2aabdd898a0139195b2b5da7387d43a45ded254. If you use a Metamask plugin you'll find the the exact steps here. Lastly, even if it is a contest bounty, we will reward all valuable contributions and efforts. We greatly appreciate the value our open source community brings to Ocean and will always award some tokens to all great contributions! :smiley:

Reward

Once the project was reviewed and merged in the master branch, you will receive the reward. PROCN is a proto-Ocean token. Bounty hunters that earn PROCN will be able to convert them 1:1 to Ocean tokens on network launch (Ocean Token will be valued at at 0.22 EUR on network launch). Network launch is expected to happen by Mar 31, 2019. Until then PROCN will be locked and non-transferrable in the ETH wallet to which it is delivered to.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 5000.0 PROCN attached to it as part of the Ocean Protocol Foundation fund.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 years, 11 months ago. Please review their action plans below:

1) sounak98 has been approved to start work.

Learn more on the Gitcoin Issue Details page.

sounak98 commented 5 years ago

The link to the repo gives a 404, @Kwinten-C can you provide the correct link?

Anirudh2490 commented 5 years ago

@sounak98 welcome! Thanks for applying for this bounty, it's great to have you on board. I see you've already made your way to gitter - https://gitter.im/oceanprotocol/Lobby. If you have any more doubts, you can ping us on Gitter. Cheers!

Anirudh2490 commented 5 years ago

@sounak98 would you have any update for us on this bounty? Do let us know if you are stuck anywhere.

sounak98 commented 5 years ago

Sorry @Anirudh2490 I was very busy with my university work for some days, I have resumed work today. Will update!

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 5000.0 PROCN has been submitted by:

  1. @sounak98

@chalidbdb please take a look at the submitted work:


gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 5000.0 PROCN attached to this issue has been approved & issued to @sounak98.