A simple java server application that uses in end-to-end encryption use-case.
- Java Development Kit (JDK) 9+
- Gradle 4.4+
Go to Developer Console Register oAuth 2.0 client
Define system variables
SECURITY_OAUTH2_CLIENT_CLIENTID=<your client identifier>
SECURITY_OAUTH2_CLIENT_CLIENTSECRET=<your client secret>
Use oAuth 2.0 to authenticate user. After login user session created. JSESSIONID
cookie used as a session identifier.
Request info
HTTP Request method GET
Request URL /user
Authentication Optional
The endpoint for WebSocket connection is /websocket
.
Send message to server if you need to refresh users list manually.
/users
/message
Message sent by a client could be received by active clients only.
Message body
{
"body": "The text of a message"
}
/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"
}
...
]
/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"
}