pac4j is meant for the web. Given all the abstractions used in the source code, this is maybe feasible to achieve something for a desktop environment, but this would require a certain amount of work.