diff options
author | Julien Boeuf <jboeuf@google.com> | 2016-06-06 09:50:38 +0200 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2016-06-06 09:50:38 +0200 |
commit | b5fe44ea0f7e5ef6f013d6c97725f93a74fed5ef (patch) | |
tree | 59a01500a39dcfa1c3aa0736fed76b636b2551ff /src | |
parent | bfc7ed66286a77ed4dca0ec1feb23912b2ec1f02 (diff) |
Adding error details for JWT and oauth2.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/security/credentials/jwt/jwt_credentials.c | 3 | ||||
-rw-r--r-- | src/core/lib/security/credentials/oauth2/oauth2_credentials.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.c b/src/core/lib/security/credentials/jwt/jwt_credentials.c index 0d29729da1..7f96e5247b 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.c +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.c @@ -116,7 +116,8 @@ static void jwt_get_request_metadata(grpc_exec_ctx *exec_ctx, GRPC_CREDENTIALS_OK, NULL); grpc_credentials_md_store_unref(jwt_md); } else { - cb(exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_ERROR, NULL); + cb(exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_ERROR, + "Could not generate JWT."); } } diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c b/src/core/lib/security/credentials/oauth2/oauth2_credentials.c index 81457183d2..a0e4b6fe8e 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.c @@ -233,10 +233,11 @@ static void on_oauth2_token_fetcher_http_response( c->token_expiration = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), token_lifetime); r->cb(exec_ctx, r->user_data, c->access_token_md->entries, - c->access_token_md->num_entries, status, NULL); + c->access_token_md->num_entries, GRPC_CREDENTIALS_OK, NULL); } else { c->token_expiration = gpr_inf_past(GPR_CLOCK_REALTIME); - r->cb(exec_ctx, r->user_data, NULL, 0, status, NULL); + r->cb(exec_ctx, r->user_data, NULL, 0, status, + "Error occured when fetching oauth2 token."); } gpr_mu_unlock(&c->mu); grpc_credentials_metadata_request_destroy(r); |