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