-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pac4jHandler not support DirectClient #249
Comments
Thanks for thoroughly reporting this issue. I will check that and let you know... |
Hi, @leleuj! |
About the If you want to create a new pac4j implementation, take a look at https://www.pac4j.org/docs/how-to-implement-pac4j-for-a-new-framework.html |
Unfortunately, Lagom hasn't context and sessions. It's a framework for microservices and all requests are stateless. That's the problem about I wrote above. I can use Play filters for changing request before it handled by Lagom. But I can't access to Play Context or Play SessionStore from Lagom Service implementation.
Thanks, I read it earlier 😄 But I am not sure that this will be a full implementation. I think, that Lagom services and Pac4j indirect clients are incompatible. But also with direct clients, there can be restrictions. If you look at my commit, I do not use a |
OK. I see. Sure, the documentation is for a whole security framework, but in your case, you only need the direct clients. |
Thanks, @leleuj ! |
I would say three classes with the I can create the lagom-pac4j repo in the pac4j organization if you are interested... |
Of course interested 👍 We planned to create a repo |
Here it is: https://github.com/pac4j/lagom-pac4j You have no push rights for now: you'll need to make PRs that I can review... |
It's great 👍
Yes, of course. Please, create an initial commit with LICENSE or README, because I can't fork empty repository for creating PR. 😄 |
Done |
Closing. Using lagom-pac4j instead. |
@leleuj will not be fixed? Does nobody use |
Many people use |
I am lucky 😂 |
Great! Let's re-open it then if you are willing to fix it :-) |
@ihostage I'm also planning to use Play-Pac4J + Deadbolt, so big thumbs up for this ;) |
#249 Pac4jHandler not support DirectClient
I try to integrate Lagom, Play-Pac4j, and Deadbolt. Sources in this repo https://github.com/ihostage/lagom-pac4j-deadbolt
But I got a problem.
Case:
Create Hello World project from maven archetype commit
https://www.lagomframework.com/documentation/1.4.x/java/GettingStartedMaven.html
Run services by command:
Check hello service:
$ curl https://localhost:9000/api/hello/Alice Hello, Alice!%
Add Pac4j and Deadbolt commit
Following the next instructions:
1) Add the required dependencies (play-pac4j + pac4j-* libraries)
2) Define the configuration (Config + Client + Authorizer + PlaySessionStore)
3c) Working with Deadbolt
Deadbolt Authorized routes
I wrote very simple
HeaderClient
(DirectClient
) and added Pac4j and Deadbolt.Check hello service without auth header:
Success 😄
Check hello service with auth header:
$ curl -H "Authorization: Alice" https://localhost:9000/api/hello/Alice authentication required%
Failed 😞
Customize Pac4jHandler commit
Add hack code for DirectClient in function
beforeAuthCheck
:Check hello service without auth header:
Success 😄
Check hello service with auth header:
Success 😄
Summury
DirectClient
. Maybe you suggest me the idiomatic way?PlayCookieSessionStore
, because I not see cookies in the server response. Maybe it's even good for stateless microservice and authentication byDirectClient
.The text was updated successfully, but these errors were encountered: