Subject: [xmpp] SCRAM example

From: Peter Saint-Andre <[email-masked]>
Date: Mon, 14 Jun 2010 14:31:14 -0600

Would someone like to write up the protocol flow for a SCRAM example?
That might be more useful than the PLAIN example.

/psa

---

From: Kevin Smith <[email-masked]>
Date: Mon, 21 Jun 2010 17:25:43 +0100

> That might be more useful than the PLAIN example.

More examples are only going to help.

/K

---

From: Waqas Hussain <[email-masked]>
Date: Tue, 22 Jun 2010 02:54:40 +0500

> That might be more useful than the PLAIN example.

The following is the log of a SCRAM negotiation between Prosody and
Pandion ([email-masked], with password r0m30myr0m30), copied
from Pandion's XML console. Also included is the decoded base64 data.

SENT: <?xml version="1.0"?>
SENT: <stream:stream to="im.example.com" xml:lang="en"
xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams"
version="1.0">
RECV: <?xml version='1.0'?><stream:stream xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
id='7cba74d8-e714-4ddd-82a0-017b0fe9b4c1' from='im.example.com'
version='1.0' xml:lang='en'>
RECV: <stream:features xmlns="jabber:client"
xmlns:stream="http://etherx.jabber.org/streams"><mechanisms
xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><auth
xmlns="http://jabber.org/features/iq-auth"/></stream:features>

SENT: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl"
mechanism="SCRAM-SHA-1">biwsbj1qdWxpZXQscj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQQ==</auth>

"n,,n=juliet,r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0AA"

RECV: <challenge xmlns:stream="http://etherx.jabber.org/streams"
xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQWUxMjQ2OTViLTY5YTktNGRlNi05YzMwLWI1MWIzODA4YzU5ZSxzPU5qaGtZVE0wTURndE5HWTBaaTAwTmpkbUxUa3hNbVV0TkRsbU5UTm1ORE5rTURNeixpPTQwOTY=</challenge>

"r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0AAe124695b-69a9-4de6-9c30-b51b3808c59e,s=NjhkYTM0MDgtNGY0Zi00NjdmLTkxMmUtNDlmNTNmNDNkMDMz,i=4096"

SENT: <response
xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLHI9b01zVEFBd0FBQUFNQUFBQU5QMFRBQUFBQUFCUFUwQUFlMTI0Njk1Yi02OWE5LTRkZTYtOWMzMC1iNTFiMzgwOGM1OWUscD1VQTU3dE0vU3ZwQVRCa0gyRlhzMFdEWHZKWXc9</response>

"c=biws,r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0AAe124695b-69a9-4de6-9c30-b51b3808c59e,p=UA57tM/SvpATBkH2FXs0WDXvJYw="

RECV: <success xmlns:stream="http://etherx.jabber.org/streams"
xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dj1wTk5ERlZFUXh1WHhDb1NFaVc4R0VaKzFSU289</success>

"v=pNNDFVEQxuXxCoSEiW8GEZ+1RSo="

--
Waqas Hussain

---

From: Peter Saint-Andre <[email-masked]>
Date: Mon, 21 Jun 2010 16:06:21 -0600

> from Pandion's XML console. Also included is the decoded base64 data.

Thanks, Waqas, that's just what I was looking for!

/psa

---

From: Peter Saint-Andre <[email-masked]>
Date: Wed, 23 Jun 2010 22:22:51 -0600

> Thanks, Waqas, that's just what I was looking for!

This has been incorporated. Thanks again.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/