Net-MitDK
view release on metacpan or search on metacpan
perl API for mit.dk
===================
This is perl interface for mit.dk, Danish national email system
Included a simple POP server for proxying mitdk for read-only mail access
and a simple downloader.
Installation
============
Browser security
----------------
Important: The authentication step proxies some requests and that doesn't go well with
the [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policy.
That's why if you try to start the authentication in a normal browser window, you
will not be able to see the MitID login window, but get an error instead.
To sidestep that, the authentication must be done with some browser security settings
lowered. You may want to use a standalone instance of a browser so it doesn't mess
with your main security settings.
* Chrome on Windows: create a folder f.ex `C:\chrome.nosec` and run
`"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\chrome.nosec"`
* Chrome on Linux: basically same, `mkdir /tmp/chrome` and `chrome --disable-web-security --user-data-dir=/tmp/chrome`
* Firefox: apparently it cannot do this, but some extentions claim that they can (simple-modify-headers etc).
I didn't succeed to setup a single one so if you know how to hack Firefox to
add `Access-Control-Allow-Origin: *` to all responses, kindly ping me back.
* Other browsers: I didn't care but again patches to this text are welcome.
Unix/Linux
----------
* Install this module by opening command line and typing `cpan Net::MitDK` (with `sudo` if needed).
* Make sure group `nobody` and user `nobody` are present. Run `sudo addgroup/adduser nobody` if needed.
Also make sure that the user nobody is a member of the group nobody. (`perl
Makefile.PL` will complain if this is not on order).
You may also add yourself to the group `nobody` if you want to let the
utilities to edit your profile settings, by running `sudo usermod -a -G nobody $USER`.
* Run `mitdk-authenticate`, open `http://localhost:9999/` in the browser with
lowered security, and login to MitID as described below.
* Add `mitdk-renew-lease -a` in a new cron job as yourself (see `examples/cron`):
- Run ``perl -le 'print q(*/10 * * * * ).($_=`which mitdk-renew-lease`,chomp,$_).q( -a)'``
- Run `crontab -e` and add this line
Windows
-------
* You'll need `perl`. Go to [strawberry perl](http://strawberryperl.com/) and fetch one.
* Install this module by opening command line and typing `cpan Net::MitDK`
* Open command line and run
`mitdk-install-win32`
( run in 1.674 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )