Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/legacy_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ ziti_auth_method_t *new_legacy_auth(uv_loop_t *loop, const char *url, tls_contex
auth->has_x509 = x509;

tlsuv_http_init(loop, &auth->http, url);
tlsuv_http_connect_timeout(&auth->http, 10 * 1000);
tlsuv_http_set_ssl(&auth->http, tls);
uv_timer_init(loop, &auth->timer);
AUTH_LOG(DEBUG, "method initialized");
Expand Down
6 changes: 3 additions & 3 deletions library/oidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ int oidc_client_configure(oidc_client_t *clt, oidc_config_cb cb) {
clt->need_refresh = true;
}

uv_timer_stop(clt->timer);
clt->configuring = true;
clt->config_cb = cb;
json_object_put(clt->config);
Expand Down Expand Up @@ -640,10 +641,9 @@ static void refresh_time_cb(uv_timer_t *t) {
}

OIDC_LOG(DEBUG, "refreshing OIDC token");
assert(clt->config);
json_object *tok = json_object_object_get(clt->tokens, "refresh_token");
if (tok == NULL) {
OIDC_LOG(DEBUG, "must restart authentication flow: no refresh_token");
if (clt->config == NULL || tok == NULL) {
OIDC_LOG(DEBUG, "must restart authentication flow: no configuration or refresh_token");
oidc_client_start(clt, clt->token_cb);
return;
}
Expand Down
14 changes: 13 additions & 1 deletion library/ziti.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ static void ziti_stop_internal(ziti_context ztx, void *data) {
ziti_set_unauthenticated(ztx, NULL);
update_ctrl_status(ztx, ZITI_DISABLED, ziti_errorstr(ZITI_DISABLED));
ztx->enabled = false;
ziti_ctrl_close(ztx_get_controller(ztx));
if (ztx->tlsCtx) {
ztx->tlsCtx->free_ctx(ztx->tlsCtx);
ztx->tlsCtx = NULL;
}

if (ztx->closing) {
shutdown_and_free(ztx);
Expand Down Expand Up @@ -921,12 +926,19 @@ void ziti_dump(ziti_context ztx, int (*printer)(void *arg, const char *fmt, ...)
ztx->auth_state);

if (ztx->auth_method->kind == OIDC) {
printer(ctx, "Session Token: %s", jwt_payload(ztx->session_token));
printer(ctx, "Session Token: %s\n", jwt_payload(ztx->session_token));
}
} else {
printer(ctx, "No Session found\n");
}

if (ztx->session_creds.cert) {
const char *cert_text = ztx->session_creds.cert->get_text(ztx->session_creds.cert);
printer(ctx, "\nSession Cert: ====\n");
printer(ctx, "%s", cert_text);
printer(ctx, "====\n");
}

printer(ctx, "\n=================\nExternal Credentials:\n");
const char *signer_name;
ziti_jwt_signer *signer;
Expand Down
Loading