Akka HTTP authentication

1,567 views
Skip to first unread message

Jason Bass

unread,
Apr 19, 2015, 8:52:17 AM4/19/15
to akka...@googlegroups.com
Spray provided an authenticate directive that could be used for HTTP authentication.  That directive appears to have been dropped in Akka HTTP (I'm using v1.0-M5).  I'm curious whether the directive will find its way into the final release or whether there is an alternate method to facilitate authentication.  Thanks,

Jason

wapgui

unread,
Apr 20, 2015, 4:37:02 AM4/20/15
to akka...@googlegroups.com
def auth = HttpBasicAuthenticator.provideUserName {
  case p @ UserCredentials.Provided(name) p.verifySecret(name + "-password")
case _ false
}

path("secure") {
HttpBasicAuthentication("My very secure site")(auth) { user
complete(HttpResponse(
entity = HttpEntity(MediaTypes.`text/html`, "<html><body>Hello <b>{ user }</b>. Access has been granted!</body></html>")))
}
}

Did you looking for something like that?

Jacobus Reyneke

unread,
Apr 21, 2015, 8:34:37 AM4/21/15
to akka...@googlegroups.com
Thanks Torsten,

Would you mind pasting the code or sharing in on a GitHub gist https://gist.github.com/ It will help people use it easier and also maybe give a bit more insight on how it works.

Cheers,
Jacobus

Jason Bass

unread,
Apr 21, 2015, 10:21:57 AM4/21/15
to akka...@googlegroups.com
Thanks Torsten.  That will do it.

Regards,
Jason

Rahul Singhai

unread,
Sep 14, 2015, 6:23:38 AM9/14/15
to Akka User List
Hi,

I am trying to implement authentication mechanism in Akka HTTP (v1.0-M5).
Do you guys know if LDAP authentication directives are available?
Is HTTPBasicAuthentication only available right now?

Rahul 

Konrad Malawski

unread,
Sep 17, 2015, 9:21:05 AM9/17/15
to Akka User List
Hi Rahul,
good catch, that directive has not been ported yet.
We're thinking if it should reside in core akka or as an external library, here's the ticket about it:

You could for now simply re-use the spray one (should be copy-paste-able):

While we decide where to put it for Akka Http.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
Konrad 'ktoso' Malawski
Message has been deleted

Rahul Singhai

unread,
Sep 17, 2015, 1:21:14 PM9/17/15
to Akka User List
Hi Konard,

Thanks for your reply.
Do you know where can I find an example of how to use the LdapAuthenticator?

Rgards,
Rahul Singhai

Konrad Malawski

unread,
Sep 17, 2015, 1:31:38 PM9/17/15
to Akka User List
Sadly it was not documented in Spray it seems:

I think we may end up pulling it in, but can not make any guarantees about that.
First we'll have to investigate if the code is good / safe and if it would be maintainable.

Help from the community to maintain the LDAP integration would be awesome, anyone interested?

-- 
Cheers,
Konrad `ktoso` Malawski

Reply all
Reply to author
Forward
0 new messages