javaplayframeworkplayframework-2.4securesocial

Use SecueSocial for PlayFramework >2.3 with UserPasswordProvider and REST (stateless token auth)


After lots of research i still wonder how to use SecureSocial with the UsernamePasswordProvider via REST. I need to get an auth token from SecureSocial after login so that i can put this token in the X-Auth-Header for future requests to secured actions in a stateless manner.

Following this answer I'm now able to login with curl but the answer from the server is empty (instead of the expected access token).

I'm using SecureSocial 3.0-M4 and PlayFramework 2.4 with Java. Unfortunately the docs for SecureSocial 3.0-M4 are not up to date, so I have no idea if this version supports such a scenario.

Is there a possibility to get SecureSocial working with X-Auth-Tokens? Does SecureSocial provide such functionality?

Thanks in advance!


Solution

  • To answer my question:

    SecureSocial provides an interface for token based authentication!

    The problem was that I sent the request to /authenticate that is used for cookie based authentication instead of sending to /api/authenticate as described here.