-
Notifications
You must be signed in to change notification settings - Fork 13
Update token endpoint response to match working standard #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
| const app = express(); | ||
| app.use(bodyParser.json()); | ||
| const port = 3000; |
There was a problem hiding this comment.
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!
would be good for @rektdeckard to confirm that this is only used as an example and is not deployed as is somewhere |
|
@lukasIO this is indeed only used as an example, the Sandbox token server is internal to |
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:
snake_casenotcamelCase- 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.participant_identity/participant_metadata/participant_attributes/room_configrequest fieldsserver_url/participant_tokenfields to the response