Link copied to clipboard!

Java

If you’re using Java on the server, this library will simplify writing the server-side portions of Cord.

Installation

Include the com.cord:server package, available in the mavenCentral() repository.

com.cord:server:0.0.+

Signing client auth tokens

Usage

import com.cord.server.*;

String clientToken = Cord.getClientAuthToken(
                "<YOUR-APP-ID>",
                "<YOUR-SECRET>",
                new ClientAuthTokenData
                        .ClientAuthTokenDataBuilder("user_id", "org_id")
                        .organizationDetails(new PlatformOrganizationVariables
                                .PlatformOrganizationVariablesBuilder("org_name")
                                .build())
                        .userDetails(new PlatformUserVariables
                                .PlatformUserVariablesBuilder("email")
                                .firstName("first_name")
                                .lastName("last_name")
                                .profilePictureUrl("url")
                                .build())
                        .build());

The result will be a valid client auth token.

In this section