comparison tests/test.ur @ 10:194577b60771

Call user-specified function after authentication
author Adam Chlipala <adam@chlipala.net>
date Wed, 29 Dec 2010 14:38:56 -0500
parents 870d99055dd1
children de04a3fc6b72
comparison
equal deleted inserted replaced
9:426dd5c88df1 10:194577b60771
1 fun afterward r = return <xml><body>
2 {case r of
3 Openid.Canceled => <xml>You canceled that sucker.</xml>
4 | Openid.Failure s => error <xml>OpenID failure: {[s]}</xml>
5 | Openid.AuthenticatedAs id => <xml>I now know you as <tt>{[id]}</tt>.</xml>}
6 </body></xml>
7
1 fun auth r = 8 fun auth r =
2 msg <- Openid.authenticate Openid.HMAC_SHA256 Openid.NoEncryption r.Id; 9 msg <- Openid.authenticate afterward
10 {AssociationType = Openid.HMAC_SHA256,
11 AssociationSessionType = Openid.NoEncryption,
12 Identifier = r.Id};
3 error <xml>{[msg]}</xml> 13 error <xml>{[msg]}</xml>
4 14
5 fun main () = return <xml><body> 15 fun main () = return <xml><body>
6 <form> 16 <form>
7 <textbox{#Id}/> 17 <textbox{#Id}/>