// CreateJWT creates an new JWT Token which can be used with the Playlyfe API
CreateJWT creates an new JWT Token which can be used with the Playlyfe API
// CreateJWT creates an new JWT Token which can be used with the Playlyfe API
func CreateJWT(clientID, clientSecret, playerID string, scopes []string, expiry time.Duration) (string, error) {
	token := jwt.New(jwt.SigningMethodHS256)
	token.Claims["player_id"] = playerID
	token.Claims["scopes"] = scopes
	token.Claims["exp"] = time.Now().Add(time.Second * expiry).Unix()
	tokenString, err := token.SignedString([]byte(clientSecret))
	return clientID + ":" + tokenString, err
}
func CreateJWT ( clientID , clientSecret , playerID string , scopes [ ] string , expiry time . Duration ) ( string , error ) { token := jwt . New ( jwt . SigningMethodHS256 ) token . Claims [ " " ] = playerID token . Claims [ " " ] = scopes token . Claims [ " " ] = time . Now ( ) . Add ( time . Second * expiry ) . Unix ( ) tokenString , err := token . SignedString ( [ ] byte ( clientSecret ) ) return clientID + " " + tokenString , err }
CreateJWT creates an new JWT Token which can be used with the Playlyfe API
CreateJWT creates an new JWT Token which can be used with the Playlyfe API