Skip to content

VirgilSecurity/demo-e2ee-server-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e2ee-server-java

A simple java server application that uses in end-to-end encryption use-case.

Prerequisites

  • Java Development Kit (JDK) 9+
  • Gradle 4.4+

! All info below is OUTDATED

Configuration

Create Google application

Go to Developer Console Register oAuth 2.0 client

Configure application

Define system variables

SECURITY_OAUTH2_CLIENT_CLIENTID=<your client identifier>
SECURITY_OAUTH2_CLIENT_CLIENTSECRET=<your client secret>

Authentication

Use oAuth 2.0 to authenticate user. After login user session created. JSESSIONID cookie used as a session identifier.

REST endpoints

Current user details

Request info

HTTP Request method    GET
Request URL            /user
Authentication         Optional

WebSocket

The endpoint for WebSocket connection is /websocket.

Destinations

Update active users list

Send message to server if you need to refresh users list manually.

/users

Send a message

/message

Message sent by a client could be received by active clients only.

Message body

{
  "body": "The text of a message"
}

Topics

Active users

/topic/activeusers

Server sends a list of active users automatically every time when client connects/disconnects to server. To receive this messages client should subscribed to the topic.

Message body

[
  {
    "name" : "User1 name",
    "email": "User1 email"
  },
  {
    "name" : "User2 name",
    "email": "User2 email"
  }
  ...
]

Receive a message

/topic/messages

Once client sends a message, this message will be received by all active clients including sender.

Message body

{
  "author":"User1 name",
  "body":"The text of a message"
}