Easily generate secure digest tokens to use with the Phenix platform without requiring any networking activity.
To install the Phenix Edge Authorization Digest Token library with gradle, add the following depencency line to your build.gradle
:
implementation 'com.phenixrts.edgeauth:edge-auth:1.2.5'
OR
compile group: 'com.phenixrts.edgeauth', name: 'edge-auth', version: '1.2.5'
To install the Phenix Edge Authorization Digest Token uberjar bundled with all its dependencies, add the following dependency to your build.gradle
:
compile group: 'com.phenixrts.edgeauth', name: 'edge-auth', version: '1.2.5', classifier: 'bundle'
import com.phenixrts.edgeauth.TokenBuilder;
// Create a token to access a channel
final String token = new TokenBuilder()
.withApplicationId("my-application-id")
.withSecret("my-secret")
.expiresInSeconds(3600)
.forChannel("us-northeast#my-application-id#my-channel.1345")
.build();
Display the help information:
java -jar build/libs/edge-auth-1.3-SNAPSHOT-bundle.jar --help
Create a token for channel access:
java -jar build/libs/edge-auth-1.3-SNAPSHOT-bundle.jar --applicationId "my-application-id" --secret "my-secret" --expiresInSeconds 3600 --channel "us-northeast#my-application-id#my-channel.1345"