From 0f89ad88df81df9d2ca7eafa276fecf8206fb598 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 9 Jul 2020 00:16:36 -0600 Subject: * 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. --- imap/src/c-client/mail.h | 1 + imap/src/c-client/oauth2_aux.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'imap/src/c-client') 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; } -- cgit v1.2.3-54-g00ecf