diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-11-21 02:19:32 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-11-21 02:19:32 -0700 |
commit | 7d652142f4960b679cb5399fc0485470af2cc878 (patch) | |
tree | 7afa6235429b5fdb835586bf671fa532b37281c3 /imap/src/c-client/auth_oa2.c | |
parent | 626eccdd8d0a325842d736596348e9d1d81ca105 (diff) | |
download | alpine-7d652142f4960b679cb5399fc0485470af2cc878.tar.xz |
* Support for code_verifier and code_challenge when generating a
refresh token and access token in Gmail using the S256 method
and plain method.
Diffstat (limited to 'imap/src/c-client/auth_oa2.c')
-rw-r--r-- | imap/src/c-client/auth_oa2.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c index 9081a1e3..45156e95 100644 --- a/imap/src/c-client/auth_oa2.c +++ b/imap/src/c-client/auth_oa2.c @@ -107,6 +107,9 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha oauth2.param[OA2_State].value = oauth2_generate_state(); + oauth2_code_challenge(&oauth2); + + oauth2_login_hint(&oauth2, user); /* * If we did not get an access token, try to get one through * our internal functions @@ -168,11 +171,6 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha *trial = 65535; /* don't retry if bad protocol */ } } - if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value); - if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value); - if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value); - if(oauth2.param[OA2_State].value) fs_give((void **) &oauth2.param[OA2_State].value); - if(oauth2.param[OA2_RefreshToken].value) fs_give((void **) &oauth2.param[OA2_RefreshToken].value); - if(oauth2.access_token) fs_give((void **) &oauth2.access_token); + oauth2_free_extra_values(oauth2); return ret; } |