Skip to content

Conversation

1egoman
Copy link
Contributor

@1egoman 1egoman commented Sep 16, 2025

As part of the TokenSource change, update the token server example to accept a request / receive a response that matches the standard that has been discussed as part of that change.

Namely, a few important details:

  • Make request / response body snake_case not camelCase - since this is an example, I made a breaking api change to the endpoint response, which I am assuming is fine. Previously the endpoint was just returning a string token though (ie, no wrapper object to rename fields within) so I don't really see an alternative unfortunately.
  • Add new participant_identity / participant_metadata / participant_attributes / room_config request fields
  • Add new server_url / participant_token fields to the response

This meant that passing a custom body to /createToken did nothing!
- Make request / response body snake_case not camelCase
- Add `participant_identity` / `participant_metadata` / `participant_attributes` / `room_config` request fields
- Add `server_url` to token generation response
Comment on lines 57 to 59
const app = express();
app.use(bodyParser.json());
const port = 3000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a FYI, there wasn't a body parser loaded in this example, so when I went to test my changes (even with the right Content-Type header), the custom request fields weren't being loaded since req.body was not being set. This should fix that!

@lukasIO
Copy link

lukasIO commented Sep 17, 2025

since this is an example, I made a breaking api change to the endpoint response, which I am assuming is fine.

would be good for @rektdeckard to confirm that this is only used as an example and is not deployed as is somewhere

@rektdeckard
Copy link
Contributor

@lukasIO this is indeed only used as an example, the Sandbox token server is internal to cloud-api-server.

@1egoman 1egoman merged commit d6137fb into main Sep 18, 2025
2 checks passed
@1egoman 1egoman deleted the update-to-match-standard branch September 18, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants