lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | IMAP |
| 5 | SASL |
| 6 | SASL AUTH OAUTH2 |
| 7 | RFC6749 |
| 8 | RFC7628 |
| 9 | </keywords> |
| 10 | </info> |
| 11 | |
| 12 | # |
| 13 | # Server-side |
| 14 | <reply> |
| 15 | <servercmd> |
| 16 | AUTH OAUTHBEARER |
| 17 | REPLY AUTHENTICATE + |
| 18 | REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== A002 OK AUTHENTICATE completed |
| 19 | </servercmd> |
| 20 | <data> |
| 21 | From: me@somewhere
|
| 22 | To: fake@nowhere
|
| 23 |
|
| 24 | body
|
| 25 |
|
| 26 | --
|
| 27 | yours sincerely
|
| 28 | </data> |
| 29 | </reply> |
| 30 | |
| 31 | # |
| 32 | # Client-side |
| 33 | <client> |
| 34 | <server> |
| 35 | imap |
| 36 | </server> |
| 37 | <name> |
| 38 | IMAP OAuth 2.0 (OAUTHBEARER) authentication |
| 39 | </name> |
| 40 | <command> |
| 41 | 'imap://%HOSTIP:%IMAPPORT/842/;UID=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> |
| 46 | perl -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> |
| 54 | A001 CAPABILITY
|
| 55 | A002 AUTHENTICATE OAUTHBEARER
|
| 56 | dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
| 57 | A003 SELECT 842
|
| 58 | A004 FETCH 1 BODY[]
|
| 59 | A005 LOGOUT
|
| 60 | </protocol> |
| 61 | </verify> |
| 62 | </testcase> |