=== Update 20190327 ===
Thanks for the comments but the demo didn't help much. After digging into the source code I got a better understanding of the framework.
What I need is
- A custom Client that extends the
BasicClient
so that a custom CredentialsExtractor can be feed into the framework. (Since my user access token cannot be extracted with the ParameterClient) - A custom CredentialsExtractor that implements
CredentialsExtractor
which you pass into the framework in the custom client(overrideclientInit
method). - Finally, a custom authenticator which is passed into the custom client.
This worked out for me.
=== Original ===
I have an existing play 2.6 application. I'm integrating pac4j and trying to make authentication work. The play server provides REST api. If I understand correctly, what I need is an http client with sql authenticator.
http://www.pac4j.org/3.3.x/docs/authenticators/sql.html
As stated in the doc, DbProfileService is needed. but it assumes a particular users table scheme which wouldn't work with the existing db.
So I suppose I need to implement an custom authenticator. But I couldn't find any useful example on the web.
So could anyone enlighten me or am I on the wrong way to do this work?