Authenticated APIs in Servant

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Authenticated APIs in Servant

Ivan Lazar Miljenovic
I'm needing to write and deploy a web API with authenticated
endpoints.  I was planning on using Servant, but it looks like there
is still no in-built support for OAuth-style token-based APIs.  Is
that correct, or did I miss something?

(That said, the actual API is of a "submit one POST and get a response
back" style rather than continuing to do more requests, so a
username/password basic authentication approach may also work if all
else fails.)

--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Authenticated APIs in Servant

Simon Hafner
I have a bunch of changes based on hoauth2 lying around, and some
connector code to servant. It will need some cleaning up before I can
release it. I'll have a go at it tomorrow.

2017-03-13 1:20 GMT+01:00 Ivan Lazar Miljenovic <[hidden email]>:

> I'm needing to write and deploy a web API with authenticated
> endpoints.  I was planning on using Servant, but it looks like there
> is still no in-built support for OAuth-style token-based APIs.  Is
> that correct, or did I miss something?
>
> (That said, the actual API is of a "submit one POST and get a response
> back" style rather than continuing to do more requests, so a
> username/password basic authentication approach may also work if all
> else fails.)
>
> --
> Ivan Lazar Miljenovic
> [hidden email]
> http://IvanMiljenovic.wordpress.com
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Authenticated APIs in Servant

Ivan Lazar Miljenovic
Thanks!

On 13 March 2017 at 11:30, Simon Hafner <[hidden email]> wrote:

> I have a bunch of changes based on hoauth2 lying around, and some
> connector code to servant. It will need some cleaning up before I can
> release it. I'll have a go at it tomorrow.
>
> 2017-03-13 1:20 GMT+01:00 Ivan Lazar Miljenovic <[hidden email]>:
>> I'm needing to write and deploy a web API with authenticated
>> endpoints.  I was planning on using Servant, but it looks like there
>> is still no in-built support for OAuth-style token-based APIs.  Is
>> that correct, or did I miss something?
>>
>> (That said, the actual API is of a "submit one POST and get a response
>> back" style rather than continuing to do more requests, so a
>> username/password basic authentication approach may also work if all
>> else fails.)
>>
>> --
>> Ivan Lazar Miljenovic
>> [hidden email]
>> http://IvanMiljenovic.wordpress.com
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Authenticated APIs in Servant

erik
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.

I have an admin/cms-type thing I've been doing a hack job of building (I often get distracted by other projects). 

Anyway, here's the login for it, which sets an auth cookie (and relies on the users library) and uses a form:


Here are the actual auth-protected APIs:


I'm not sure if it'll help much, but there it is.

Erik


On Mar 12, 2017 5:42 PM, "Ivan Lazar Miljenovic" <[hidden email]> wrote:
Thanks!

On 13 March 2017 at 11:30, Simon Hafner <[hidden email]> wrote:
> I have a bunch of changes based on hoauth2 lying around, and some
> connector code to servant. It will need some cleaning up before I can
> release it. I'll have a go at it tomorrow.
>
> 2017-03-13 1:20 GMT+01:00 Ivan Lazar Miljenovic <[hidden email]>:
>> I'm needing to write and deploy a web API with authenticated
>> endpoints.  I was planning on using Servant, but it looks like there
>> is still no in-built support for OAuth-style token-based APIs.  Is
>> that correct, or did I miss something?
>>
>> (That said, the actual API is of a "submit one POST and get a response
>> back" style rather than continuing to do more requests, so a
>> username/password basic authentication approach may also work if all
>> else fails.)
>>
>> --
>> Ivan Lazar Miljenovic
>> [hidden email]
>> http://IvanMiljenovic.wordpress.com
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Loading...