Code Monkey home page Code Monkey logo

digital-identity's Introduction

Digital Identity

Capstone Client - Tata Consultancy Services

The project has several components -

  • Producer Server
  • Consumer server
  • Android Application
  • Blockchain

To run the Android app -

  1. Navigate to https://firebase.google.com/docs/android/setup#console

  2. Follow the steps prescribed under the section "Option1: Add Firebase using the Firebase console"

  3. In step 2, use the Android package name as "com.example.producerapp." These steps are required to acquire the "google-services.json" file for your device.

  4. Navigate to your Firebase console and click on your project. Click on the settings icon, select "Project settings" and navigate to the "Cloud Messaging" tab.

  5. Make a note of the values in the fields "Sender ID" and "Server key".

  6. Run the app on your device. Go to your Firebase project, go to Cloud Messaging and create a new notification with the following fields:
    Notification Notification title = Test Notification Notification text = Test Notification Text Target App = com.example.producerapp Scheduling Send to eligible users = Now Additional options Custom data (Add 1 key-value pair here) message = Authentication

  7. You will receive a notification on your app. The Android Studio console will display a message that says "YOUR TOKEN IS: ." Make a note of this token value.

  8. The app may crash if you click on the notification and select yes/no, since it has not been configured completely.

To run the servers -

  1. Go to src->main->java->edu.cmu.producerserver->utils->MessagingCredentials and paste the value of "Sender ID" from the previous step in the "projectID" field and the "Server key" in the "apiKey" field.
  2. Paste the token value in the field "senderRegistrationID" .
  3. Download and Install Ganache GUI from - https://www.trufflesuite.com/ganache
  4. Open Ganache, Settings, and make sure that the Server Port number is 8545.
  5. Create a save a Workspace using a name of your choice.
  6. On the Accounts page, you will have 10 accounts and their corresponding addresses.
  7. Click on the "key" icon of one of the accounts and copy the Private key value to PRIVATE_KEY variable in the Transaction class of the blockchain folder, src->main->java->edu.cmu.producerserver->service Transaction class, and src->main->java->edu.cmu.consumerserver->service Transaction class.
  8. Run the Blockchain class in the blockchain folder.
  9. There will be an address printed on the console. This is the address where the Contract is deployed. This contract holds a map of the ID and the public keys for the producer and consumer that we have defined for the purpose of demonstration of this prototype.
  10. Copy the address and paste it to the deployedAddress variable in src->main->java->edu.cmu.producerserver->service Transaction and src->main->java->edu.cmu.consumerserver->service Transaction class.
  11. Run the Producer server and the Consumer server
  12. Go to the command line and make a note of the producer server's IP address
  13. In the android project, go to app->src->main->java->com->example->producerapp->ServerDetails. Set urlString to "http://<producer server's IP address>:8082". Run the app again.
  14. Run the different stages of the application.

Encryption

We're using jasypt to encrypt the database connection url and password.

Usage:

  1. Include dependency in pom.xml

    <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>2.1.0</version> </dependency>

  2. Add your private key into application.properties jasypt.encryptor.password=<your private key>

  3. Encrypt the url/password with your private key

    @Autowired StringEncryptor encryptor;

    @Test void getPass() {

    String url = encryptor.encrypt(<your url>);

    }

  4. Replace the original url with the encrypted string in application.properties

    spring.data.mongodb.uri=ENC(<your encrypted string>)

  5. Remove your private key from application.propterties

  6. Make your private key as a runtime parameter

    -jasypt.encryptor.password=<your private key>

digital-identity's People

Contributors

nanonero avatar poojithaprasad94 avatar shunqi avatar vinitshah298 avatar mwaqasaziz7 avatar

Stargazers

 avatar SHIVAM GANGWAR avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Forkers

vinitshah298

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.