Skip to content
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

Value injector for RESTEasy #6

Closed
victornoel opened this issue Oct 9, 2016 · 10 comments
Closed

Value injector for RESTEasy #6

victornoel opened this issue Oct 9, 2016 · 10 comments

Comments

@victornoel
Copy link
Member

For now value injection with @Pac4JProfile and @Pac4JProfileManager only works with Jersey.

@rkorn86
Copy link

rkorn86 commented Nov 9, 2016

Is there currently any workaround to use resteasy with @Pac4JCallback? Im stuck on Wildfly 10 and RESTeasy.

@victornoel
Copy link
Member Author

@rkorn86 there is no problem with @Pac4JCallbac with resteasy… or at least it doesn't concern this issue!

Why don't you come explain your problem in details on the pac4j-user mailing list? It would be easier to help you :)

@rkorn86
Copy link

rkorn86 commented Nov 9, 2016

@victornoel
Copy link
Member Author

To implement this, we would need to implement something like this: https://dzone.com/articles/annotations-your-way-resteasy

@victornoel
Copy link
Member Author

victornoel commented Nov 9, 2016

@victornoel
Copy link
Member Author

@rkorn86 I will think of workaround tomorrow :)

@victornoel
Copy link
Member Author

Ok, so here are some ideas to get the current profile inside a resource method:

If you are running on top of a servlet container, you can very simply exploits the HttpServletRequest as explained there:

@GET
public void get(@Context HttpServletRequest request) {
    ProfileManager manager = new ProfileManager(new J2EContext(request, null));
    Optional<CommonProfile> profile = manager.get(true);
}

If not, then it should be possible but a bit more complex, I will think about it in the future…

@rkorn86
Copy link

rkorn86 commented Nov 11, 2016

Workaround works like a charm. Sorry, but I dont have the time/knowledge to help you currently.

@victornoel
Copy link
Member Author

Great, I will add it to the README. No problem for the help :)

@victornoel
Copy link
Member Author

Closed by #31 :) Thanks again @yegorius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants