<div dir="auto">I don't know if this will be useful to you (and it may be poorly done), but I've been slowly cobbling together my personal profile site using servant and elm for the frontend, just for fun.<div dir="auto"><br></div><div dir="auto">I have an admin/cms-type thing I've been doing a hack job of building (I often get distracted by other projects). </div><div dir="auto"><br></div><div dir="auto">Anyway, here's the login for it, which sets an auth cookie (and relies on the <i>users</i> library) and uses a form:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/pellagic-puffbomb/simpleservantblog/blob/master/src/Api/Admin/Login.hs">https://github.com/pellagic-puffbomb/simpleservantblog/blob/master/src/Api/Admin/Login.hs</a><br></div><div dir="auto"><br></div><div dir="auto">Here are the actual auth-protected APIs:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/pellagic-puffbomb/simpleservantblog/blob/master/src/Api/Admin/Admin.hs">https://github.com/pellagic-puffbomb/simpleservantblog/blob/master/src/Api/Admin/Admin.hs</a><br></div><div dir="auto"><br></div><div dir="auto">I'm not sure if it'll help much, but there it is.</div><br><div class="gmail_extra" dir="auto">Erik</div><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra" dir="auto"><br><div class="gmail_quote" dir="auto">On Mar 12, 2017 5:42 PM, "Ivan Lazar Miljenovic" <<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks!<br>
<div class="elided-text"><br>
On 13 March 2017 at 11:30, Simon Hafner <<a href="mailto:hafnersimon@gmail.com">hafnersimon@gmail.com</a>> wrote:<br>
> I have a bunch of changes based on hoauth2 lying around, and some<br>
> connector code to servant. It will need some cleaning up before I can<br>
> release it. I'll have a go at it tomorrow.<br>
><br>
> 2017-03-13 1:20 GMT+01:00 Ivan Lazar Miljenovic <<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>>:<br>
>> I'm needing to write and deploy a web API with authenticated<br>
>> endpoints.  I was planning on using Servant, but it looks like there<br>
>> is still no in-built support for OAuth-style token-based APIs.  Is<br>
>> that correct, or did I miss something?<br>
>><br>
>> (That said, the actual API is of a "submit one POST and get a response<br>
>> back" style rather than continuing to do more requests, so a<br>
>> username/password basic authentication approach may also work if all<br>
>> else fails.)<br>
>><br>
>> --<br>
>> Ivan Lazar Miljenovic<br>
>> <a href="mailto:Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>
>> <a href="http://IvanMiljenovic.wordpress.com" rel="noreferrer" target="_blank">http://IvanMiljenovic.<wbr>wordpress.com</a><br>
>> ______________________________<wbr>_________________<br>
>> Haskell-Cafe mailing list<br>
>> To (un)subscribe, modify options or view archives go to:<br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
>> Only members subscribed via the mailman list are allowed to post.<br>
> ______________________________<wbr>_________________<br>
> Haskell-Cafe mailing list<br>
> To (un)subscribe, modify options or view archives go to:<br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
<br>
<br>
<br>
--<br>
Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" rel="noreferrer" target="_blank">http://IvanMiljenovic.<wbr>wordpress.com</a><br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</div></blockquote></div><br></div></div>