diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-03-27 21:36:52 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-03-27 21:36:52 -0600 |
commit | c5a870b30c43914ed8414b9f54bed3da27057d79 (patch) | |
tree | 9827efdac51b81bda6e813cadc2375415e99b734 /alpine | |
parent | a5c42906261fefe477422cf106cbd0ce934e0173 (diff) | |
download | alpine-c5a870b30c43914ed8414b9f54bed3da27057d79.tar.xz |
* Remove the ability to choose between the device and authorize methods
to login to outlook, since the original client-id can only be used
for the device method. One needs a special client-id and client-secret
to use the authorize method in Outlook.
Diffstat (limited to 'alpine')
-rw-r--r-- | alpine/imap.c | 21 | ||||
-rw-r--r-- | alpine/xoauth2.h | 4 |
2 files changed, 18 insertions, 7 deletions
diff --git a/alpine/imap.c b/alpine/imap.c index 2e02ef6..fa7b0d7 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -175,7 +175,8 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* expiration time */ 0, /* first time indicator */ 1, /* client secret required */ - 0 /* Cancel refresh token */ + 0, /* Cancel refresh token */ + GMAIL_FLAGS /* default flags. For Gmail this should be set to OA2_AUTHORIZE */ }, {OUTLOOK_NAME, {"outlook.office365.com", "smtp.office365.com", NULL, NULL}, @@ -207,7 +208,8 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* expiration time */ 0, /* first time indicator */ 0, /* client secret required */ - 0 /* Cancel refresh token */ + 0, /* Cancel refresh token */ + OUTLOOK_FLAGS /* default flags. For OUTLOOK this should be set to OA2_DEVICE */ }, {OUTLOOK_NAME, {"outlook.office365.com", "smtp.office365.com", NULL, NULL}, @@ -239,7 +241,8 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* expiration time */ 0, /* first time indicator */ 1, /* client secret required */ - 0 /* Cancel refresh token */ + 0, /* Cancel refresh token */ + OUTLOOK_FLAGS /* default flags. For OUTLOOK this should be set to OA2_DEVICE */ }, {YAHOO_NAME, {"imap.mail.yahoo.com", "smtp.mail.yahoo.com", NULL, NULL}, @@ -271,7 +274,8 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* expiration time */ 0, /* first time indicator */ 1, /* client secret required */ - 0 /* Cancel refresh token */ + 0, /* Cancel refresh token */ + YAHOO_FLAGS /* default flags. For YAHOO this should be set to OA2_AUTHORIZE */ }, {YANDEX_NAME, {"imap.yandex.com", "smtp.yandex.com", NULL, NULL}, @@ -303,9 +307,10 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* expiration time */ 0, /* first time indicator */ 1, /* client secret required */ - 0 /* Cancel refresh token */ + 0, /* Cancel refresh token */ + YANDEX_FLAGS /* defaul flags. For YANDEX this should be set to OA2_AUTHORIZE */ }, - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0}, }; int @@ -1111,7 +1116,9 @@ mm_login_oauth2(NETMBX *mb, char *user, char *method, && oa2 && oa2->host[j] != NULL && strucmp(oa2->host[j], mb->orighost) != 0; j++); - if(oa2 && oa2->host && j < OAUTH2_TOT_EQUIV && oa2->host[j]) + if(oa2 && oa2->host && j < OAUTH2_TOT_EQUIV && oa2->host[j] + && ((oa2->server_mthd[0].name && (oa2->flags & OA2_AUTHORIZE)) + || (oa2->server_mthd[1].name && (oa2->flags & OA2_DEVICE)))) nmethods++; } diff --git a/alpine/xoauth2.h b/alpine/xoauth2.h index e889078..2abd1ff 100644 --- a/alpine/xoauth2.h +++ b/alpine/xoauth2.h @@ -19,20 +19,24 @@ #define GMAIL_ID "624395471329-0qee3goofj7kbl7hsukou3rqq0igntv1.apps.googleusercontent.com" #define GMAIL_SECRET "vwnqVJQrJZpR6JilCfAN5nY7" #define GMAIL_TENANT NULL +#define GMAIL_FLAGS (OA2_AUTHORIZE) #define OUTLOOK_NAME "Outlook" #define OUTLOOK_ID "f21dcaf2-8020-469b-8135-343bfc35d046" #define OUTLOOK_SECRET "Tk-DAcEi13-FeSsY_Ja4Y.-MyL66I.wIPt" #define OUTLOOK_TENANT "common" +#define OUTLOOK_FLAGS (OA2_DEVICE) #define YANDEX_NAME "Yandex" #define YANDEX_ID "393578fee26f47858023cf59681882a7" #define YANDEX_SECRET "7304c4993583498f8ab63e2f21ad6960" #define YANDEX_TENANT NULL +#define YANDEX_FLAGS (OA2_AUTHORIZE) #define YAHOO_NAME "Yahoo!" #define YAHOO_ID "dj0yJmk9RTdyZEQ2TWxGMzV6JmQ9WVdrOWVrTllZbGgyV2tjbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PTli" #define YAHOO_SECRET "3a8b12d51c09b0a5c0733c36d04cd3c69e33baef" #define YAHOO_TENANT NULL +#define YAHOO_FLAGS (OA2_AUTHORIZE) #endif /* ALPINE_XOAUTH2_INCLUDED */ |