{"action":"created","issue":{"url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/3","repository_url":"https://api.github.com/repos/pac4j/jax-rs-pac4j","labels_url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/3/comments","events_url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/3/events","html_url":"https://github.com/pac4j/jax-rs-pac4j/pull/3","id":181665810,"number":3,"title":"WIP: Url prefix handling","user":{"login":"victornoel","id":160975,"avatar_url":"https://avatars.githubusercontent.com/u/160975?v=3","gravatar_id":"","url":"https://api.github.com/users/victornoel","html_url":"https://github.com/victornoel","followers_url":"https://api.github.com/users/victornoel/followers","following_url":"https://api.github.com/users/victornoel/following{/other_user}","gists_url":"https://api.github.com/users/victornoel/gists{/gist_id}","starred_url":"https://api.github.com/users/victornoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victornoel/subscriptions","organizations_url":"https://api.github.com/users/victornoel/orgs","repos_url":"https://api.github.com/users/victornoel/repos","events_url":"https://api.github.com/users/victornoel/events{/privacy}","received_events_url":"https://api.github.com/users/victornoel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-07T13:14:56Z","updated_at":"2016-10-09T09:57:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/pulls/3","html_url":"https://github.com/pac4j/jax-rs-pac4j/pull/3","diff_url":"https://github.com/pac4j/jax-rs-pac4j/pull/3.diff","patch_url":"https://github.com/pac4j/jax-rs-pac4j/pull/3.patch"},"body":"Basically, the idea is that when running under a servlet container, the URLs as manipulated in the JAX-RS code (in `@Path` but also in the `@Pac4J*` annotations) should be relative to the context where the JAX-RS implementation is deployed.\r\n\r\nFor example if the servlet context is `/application` and on top of that, the servlet mapping path is `/api`, then all the URLs are prefixed in practice by `/application/api/`.\r\nThis is what is called `urlPrefix` in this PR.\r\n\r\nWhen setting up the filters (under the responsibility of the user of the library, for example dropwizard-pac4j, and not of jax-rs-pac4j), the user can specify this prefix and design its application without worrying of the context.\r\n\r\nLike this, if one specify `@Pac4JCallback(defaultUrl = \"/user\")`, the redirect will be prefixed by the `urlPrefix` as expected by the developer.\r\n\r\nThis is not totally complete, it applies to all parameters passed to the annotations only.\r\nThis is because pac4j does not take such concerns into account and thus the redirects that are done by the clients or things like that are not aware of the prefix. But at least, this is coherent in the realm of the jax-rs annotations!\r\n\r\n@leleuj if you could give me a quick opinion on this before I merge it, it would be great, in case I missed something somewhere :)"},"comment":{"url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/comments/252476938","html_url":"https://github.com/pac4j/jax-rs-pac4j/pull/3#issuecomment-252476938","issue_url":"https://api.github.com/repos/pac4j/jax-rs-pac4j/issues/3","id":252476938,"user":{"login":"victornoel","id":160975,"avatar_url":"https://avatars.githubusercontent.com/u/160975?v=3","gravatar_id":"","url":"https://api.github.com/users/victornoel","html_url":"https://github.com/victornoel","followers_url":"https://api.github.com/users/victornoel/followers","following_url":"https://api.github.com/users/victornoel/following{/other_user}","gists_url":"https://api.github.com/users/victornoel/gists{/gist_id}","starred_url":"https://api.github.com/users/victornoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victornoel/subscriptions","organizations_url":"https://api.github.com/users/victornoel/orgs","repos_url":"https://api.github.com/users/victornoel/repos","events_url":"https://api.github.com/users/victornoel/events{/privacy}","received_events_url":"https://api.github.com/users/victornoel/received_events","type":"User","site_admin":false},"created_at":"2016-10-09T09:57:26Z","updated_at":"2016-10-09T09:57:26Z","body":"@leleuj actually you were right, jax-rs gives us the possibility to get this information, so no need for passing it as an option :)\r\n\r\nI updated the PR, I think it's quite nice now, I will close pac4j/dropwizard-pac4j#11 which is now useless!\r\n\r\nStill, it doesn't change the fact that it only covers the urls passed as parameters to the filters (or to the annotations)."}}
{"actor":{"display_login":"victornoel"}}