diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-01-15 12:42:06 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-01-15 12:42:06 -0700 |
commit | 9822842646bc2b940d4b98a260ee4e3ac26fce57 (patch) | |
tree | 9d468eb7a6d6b3a41c6c8cd7d542009cb498bc5b /imap/src/c-client/auth_oa2.c | |
parent | 36fcd566e99d76543c28ce985fc71e8a7cfb6c83 (diff) | |
download | alpine-9822842646bc2b940d4b98a260ee4e3ac26fce57.tar.xz |
* Add configuration screen for XOAUTH, so users can configure their own
client-id and client-secret information.
Diffstat (limited to 'imap/src/c-client/auth_oa2.c')
-rw-r--r-- | imap/src/c-client/auth_oa2.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c index 907f722f..7ac1cb23 100644 --- a/imap/src/c-client/auth_oa2.c +++ b/imap/src/c-client/auth_oa2.c @@ -228,15 +228,17 @@ mm_login_oauth2_c_client_method (NETMBX *mb, char *user, char *s = NULL; JSON_S *json = NULL; - if(oauth2->param[OA2_Id].value == NULL - || oauth2->param[OA2_Secret].value == NULL){ - /* - * We need to implement client-side entering client_id and - * client_secret, and other parameters. In the mean time, bail out. - */ - return; + if(oauth2->param[OA2_Id].value == NULL || oauth2->param[OA2_Secret].value == NULL){ + oauth2clientinfo_t ogci = + (oauth2clientinfo_t) mail_parameters (NIL, GET_OA2CLIENTINFO, NIL); + + if(ogci) (*ogci)(oauth2->name, &oauth2->param[OA2_Id].value, + &oauth2->param[OA2_Secret].value); } + if(oauth2->param[OA2_Id].value == NULL || oauth2->param[OA2_Secret].value == NULL) + return; + /* first check if we have a refresh token, and in that case use it */ if(oauth2->param[OA2_RefreshToken].value){ |