summaryrefslogtreecommitdiff
path: root/imap
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-05-09 15:01:59 -0600
committerEduardo Chappa <chappa@washington.edu>2020-05-09 15:01:59 -0600
commit78ebe5ef4a47e4fe03e7b52afef0fb66e0de2378 (patch)
treef2552f49259aca8db3cd86d58a3bc152e00a8c2c /imap
parentc1be3b9cad0cf1b7a791d27fe3ab3fc95d75e6e9 (diff)
downloadalpine-78ebe5ef4a47e4fe03e7b52afef0fb66e0de2378.tar.xz
* Several improvements to Alpine's support of XOAUTH2. In the case of Gmail,
a text explaining the basic steps on how to configure fully Alpine with Gmail was added. In addition, some issues introduced while included OAUTHBEARER were also fixed.
Diffstat (limited to 'imap')
-rw-r--r--imap/src/c-client/auth_bea.c7
-rw-r--r--imap/src/c-client/auth_oa2.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/imap/src/c-client/auth_bea.c b/imap/src/c-client/auth_bea.c
index b9bf61e..2273b41 100644
--- a/imap/src/c-client/auth_bea.c
+++ b/imap/src/c-client/auth_bea.c
@@ -139,6 +139,11 @@ long auth_oauthbearer_client (authchallenge_t challenger,authrespond_t responder
/* empty challenge or user requested abort or client does not have info */
if(!oauth2.access_token) {
+ if (base){
+ (*responder) (stream,base,"",strlen(base));
+ if ((challenge = (*challenger) (stream,&clen)) != NULL)
+ fs_give ((void **) &challenge);
+ }
(*responder) (stream,NIL,NIL,0);
*trial = 0; /* cancel subsequent attempts */
ret = LONGT; /* will get a BAD response back */
@@ -297,7 +302,7 @@ mm_login_oauth2_c_client_method (NETMBX *mb, char *user, char *method,
(oauth2getaccesscode_t) mail_parameters (NIL, GET_OA2CLIENTGETACCESSCODE, NIL);
if(ogac)
- oauth2->param[OA2_Code].value = (*ogac)(url, BEARERNAME, oauth2, tryanother);
+ oauth2->param[OA2_Code].value = (*ogac)(url, method, oauth2, tryanother);
}
if(oauth2->param[OA2_Code].value){
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c
index 4c4a589..76a529e 100644
--- a/imap/src/c-client/auth_oa2.c
+++ b/imap/src/c-client/auth_oa2.c
@@ -170,6 +170,11 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha
/* empty challenge or user requested abort or client does not have info */
if(!oauth2.access_token) {
+ if (base){
+ (*responder) (stream,base,"",strlen(base));
+ if ((challenge = (*challenger) (stream,&clen)) != NULL)
+ fs_give ((void **) &challenge);
+ }
(*responder) (stream,NIL,NIL,0);
*trial = 0; /* cancel subsequent attempts */
ret = LONGT; /* will get a BAD response back */
@@ -241,7 +246,7 @@ mm_login_oauth2_c_client_method (NETMBX *mb, char *user, char *method,
oauth2clientinfo_t ogci =
(oauth2clientinfo_t) mail_parameters (NIL, GET_OA2CLIENTINFO, NIL);
- if(ogci) (*ogci)(oauth2->name, method, &oauth2->param[OA2_Id].value,
+ if(ogci) (*ogci)(oauth2->name, &oauth2->param[OA2_Id].value,
&oauth2->param[OA2_Secret].value);
}
@@ -315,7 +320,7 @@ mm_login_oauth2_c_client_method (NETMBX *mb, char *user, char *method,
(oauth2getaccesscode_t) mail_parameters (NIL, GET_OA2CLIENTGETACCESSCODE, NIL);
if(ogac)
- oauth2->param[OA2_Code].value = (*ogac)(url, oauth2, tryanother);
+ oauth2->param[OA2_Code].value = (*ogac)(url, method, oauth2, tryanother);
}
if(oauth2->param[OA2_Code].value){