[
https://issues.apache.org/jira/browse/DELTASPIKE-860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14371166#comment-14371166
]
The Alchemist commented on DELTASPIKE-860:
------------------------------------------
Ah, thanks, [~rsmeral]. I see a few options:
# rename the class from {{LoggedIn}} to something like {{CustomQualifier}} to
make it obvious {{org.picketlink.authorization.annotations.LoggedIn}} isn't the
one used
# remove the {{@LoggedIn}} parameter completely from the documentation
# demonstrate a way to achieve a similar result, perhaps by injecting a
{{@Principal}} into a {{@RequestScoped}} authorizer?
# other options?
What do you think? Is it worth submitting a pull request for
https://github.com/apache/deltaspike/blob/master/documentation/src/main/asciidoc/security.adoc?
> documentation says "@LoggedIn User user", but that's impossible
> ---------------------------------------------------------------
>
> Key: DELTASPIKE-860
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-860
> Project: DeltaSpike
> Issue Type: Bug
> Reporter: The Alchemist
>
> h3. Documentation Snippet
> http://deltaspike.apache.org/documentation/security.html
> {noformat}
> Create the Authorizer
> @ApplicationScoped
> public class CustomAuthorizer
> {
> @Secures
> @CustomSecurityBinding
> public boolean doSecuredCheck(InvocationContext invocationContext,
> BeanManager manager, @LoggedIn User user) throws Exception
> {
> return user.isLoggedIn(); // perform security check
> }
> }
> {noformat}
> h3. Compilation Error
> {noformat}
> The annotation @LoggedIn is disallowed for this location
> {noformat}
> h3. Explanation?
> I think it's because {{LoggedIn}} is missing a {{@Target}} of {{PARAMETER}}.
> {code:java,title=LoggedIn.java}
> @Retention(value = RetentionPolicy.RUNTIME)
> @Target({ ElementType.TYPE, ElementType.METHOD })
> @Documented
> @SecurityBindingType
> public @interface LoggedIn {
> {code}
> h3. Conclusion
> Not sure if this is supposed to work, given that {{LoggedIn}} is part of
> PicketLink, not DeltaSpike.
> Is there a workaround for this type of situation?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)