Skip to content
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

bump oidc callback buffer, log access token content #809

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

ekoby
Copy link
Member

@ekoby ekoby commented Jan 15, 2025

No description provided.

@ekoby ekoby requested a review from a team as a code owner January 15, 2025 02:27
@@ -816,6 +816,25 @@ int oidc_client_close(oidc_client_t *clt, oidc_close_cb cb) {
return 0;
}

static const char *jwt_payload(const char *jwt) {
static uint8_t payload[4096];
Copy link
Member

Choose a reason for hiding this comment

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

imo, seems like it would be better to pass the length or use a #define ?

@@ -825,7 +844,12 @@ static void oidc_client_set_tokens(oidc_client_t *clt, json_object *tok_json) {
if (clt->token_cb) {
struct json_object *access_token = json_object_object_get(clt->tokens, "access_token");
if (access_token) {
clt->token_cb(clt, OIDC_TOKEN_OK, json_object_get_string(access_token));
const char *token = json_object_get_string(access_token);
ZITI_LOG(DEBUG, "access_token=%s", jwt_payload(token));
Copy link
Member

Choose a reason for hiding this comment

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

this will be really useful to debug! thx

@@ -502,7 +502,7 @@ static void ext_accept(uv_work_t *wr) {
return;
}

char buf[1024];
char buf[4096];
Copy link
Member

Choose a reason for hiding this comment

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

some tokens are bigger than others... :)

Copy link
Member Author

Choose a reason for hiding this comment

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

this does not get receive token

@ekoby ekoby merged commit 1ee4f17 into main Jan 15, 2025
19 checks passed
@ekoby ekoby deleted the jwt-logging branch January 15, 2025 02:55
ekoby added a commit to openziti/ziti-tunnel-sdk-c that referenced this pull request Jan 16, 2025
- fix error when the last message header is zero-length (openziti/ziti-sdk-c#810)
- bump oidc callback buffer, log access token content (openziti/ziti-sdk-c#809)
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.

2 participants