3

How should I go about performing authentication and authorization during testing for a yesod haskell app? My handlers begin with requireAuth and my authentication plugin is browserID.

So I want to log a user in and do what that handler pertains. Doing this for several handlers.

My code is: https://github.com/urbanslug/payroll-web/tree/development

I have read https://github.com/yesodweb/yesod/wiki/Performing-Authentication-during-Testing but I really don't get it plus it seems outdated since some types like OneSpec are out of scope and aren't on hayoo.

urbanslug
  • 146
  • 1
  • 8
  • Did you get the code from that yesod wiki page working and try to modify it for your needs? – codygman Mar 02 '15 at 21:11
  • @Codygman I tried to but couldn't get it to work because `doRequest` doesn't seem to exist in the relevant libraries anymore. Also to add to that BrowserID authentication can only be done through JS as far as I can tell so I'd have to find a way to call JS functions from my haskell tests. – urbanslug Mar 03 '15 at 03:11

1 Answers1

2

The code in that wiki article is now updated. The details in that code are right for the HashDB authentication plugin, but would need to be modified for BrowserID.

Paul Rouse
  • 131
  • 2