Package com.cord.server
Class Cord
java.lang.Object
com.cord.server.Cord
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetClientAuthToken(String app_id, String secret, ClientAuthTokenData payload)This method should be used to sign a JWT token and send it to the frontend part of the application, which will use the said token to authenticate the web components.static StringgetServerAuthToken(String app_id, String secret)This method should be used to sign a JWT token which is required to authenticate for the Cord REST APIs.
-
Constructor Details
-
Cord
public Cord()
-
-
Method Details
-
getClientAuthToken
This method should be used to sign a JWT token and send it to the frontend part of the application, which will use the said token to authenticate the web components.- Parameters:
app_id- The application id, found in console.cord.comsecret- The secret corresponding to the application id, also found in console.cord.cordpayload- The payload of type ClientAuthTokenData which should contain the user and organization information for the particular user you want to authenticate- Returns:
- A signed JWT token which should successfully authenticate a user in the frontend web components
-
getServerAuthToken
This method should be used to sign a JWT token which is required to authenticate for the Cord REST APIs. The relevant APIs are used to sync your users and organizations with the Cord data- Parameters:
app_id- The application id, found in console.cord.comsecret- The secret corresponding to the application id, also found in console.cord.cord- Returns:
- A signed JWT token which should successfully authenticate all REST API requests
-