summaryrefslogtreecommitdiff
path: root/imap
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-07-09 00:16:36 -0600
committerEduardo Chappa <chappa@washington.edu>2020-07-09 00:16:36 -0600
commit0f89ad88df81df9d2ca7eafa276fecf8206fb598 (patch)
treeb8c24c61a7b9959241c5bfc0d95b7fe2f595c323 /imap
parent560dd4993146181912c3bb98f6b26f7ed7f4de5d (diff)
downloadalpine-0f89ad88df81df9d2ca7eafa276fecf8206fb598.tar.xz
* Add choice of Authorization flow to Alpine. Alpine supports two ways to get
authorization to read email. One is called "Authorize" and the other "Device". Some servers support both, some only one. For servers that support both, Alpine will ask if it does not know which method to choose. Inspired by a conversation with Pieter Jacques.
Diffstat (limited to 'imap')
-rw-r--r--imap/src/c-client/mail.h1
-rw-r--r--imap/src/c-client/oauth2_aux.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/imap/src/c-client/mail.h b/imap/src/c-client/mail.h
index 65e02288..32df37ba 100644
--- a/imap/src/c-client/mail.h
+++ b/imap/src/c-client/mail.h
@@ -1993,6 +1993,7 @@ typedef struct xoauth_default_s {
char *client_secret;
char *tenant;
char *users;
+ char *flow;
} XOAUTH2_INFO_S;
/* Supporting external functions for XOAUTH2 and OAUTHBEARER */
diff --git a/imap/src/c-client/oauth2_aux.c b/imap/src/c-client/oauth2_aux.c
index e7b14c69..24827e70 100644
--- a/imap/src/c-client/oauth2_aux.c
+++ b/imap/src/c-client/oauth2_aux.c
@@ -386,6 +386,7 @@ void free_xoauth2_info(XOAUTH2_INFO_S **xp)
if((*xp)->client_id) fs_give((void **) &(*xp)->client_id);
if((*xp)->client_secret) fs_give((void **) &(*xp)->client_secret);
if((*xp)->tenant) fs_give((void **) &(*xp)->tenant);
+ if((*xp)->flow) fs_give((void **) &(*xp)->flow);
if((*xp)->users) fs_give((void **) &(*xp)->users);
fs_give((void **) xp);
}
@@ -400,6 +401,7 @@ XOAUTH2_INFO_S *copy_xoauth2_info(XOAUTH2_INFO_S *x)
if(x->client_id) y->client_id = cpystr(x->client_id);
if(x->client_secret) y->client_secret = cpystr(x->client_secret);
if(x->tenant) y->tenant = cpystr(x->tenant);
+ if(x->flow) y->flow = cpystr(x->flow);
if(x->users) y->users = cpystr(x->users);
return y;
}