1<testcase> 2<info> 3<keywords> 4IMAP 5SASL 6SASL AUTH OAUTH2 7RFC6749 8RFC7628 9</keywords> 10</info> 11 12# 13# Server-side 14<reply> 15<servercmd> 16AUTH OAUTHBEARER 17REPLY AUTHENTICATE + 18REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== A002 OK AUTHENTICATE completed 19</servercmd> 20<data> 21From: me@somewhere 22To: fake@nowhere 23 24body 25 26-- 27 yours sincerely 28</data> 29</reply> 30 31# 32# Client-side 33<client> 34<server> 35imap 36</server> 37 <name> 38IMAP OAuth 2.0 (OAUTHBEARER) authentication 39 </name> 40 <command> 41'imap://%HOSTIP:%IMAPPORT/842/;MAILINDEX=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM 42</command> 43# The protocol section doesn't support ways of specifying the raw data in the 44# base64 encoded message so we must assert this 45<precheck> 46perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%IMAPPORT' ne '9003' );" 47</precheck> 48</client> 49 50# 51# Verify data after the test has been "shot" 52<verify> 53<protocol> 54A001 CAPABILITY 55A002 AUTHENTICATE OAUTHBEARER 56dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 57A003 SELECT 842 58A004 FETCH 1 BODY[] 59A005 LOGOUT 60</protocol> 61</verify> 62</testcase> 63