Annotation Type CurrentSecurityContext

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean errorOnInvalidType
      True if a ClassCastException should be thrown when the current SecurityContext is the incorrect type.
      java.lang.String expression
      If specified, will use the provided SpEL expression to resolve the security context.
    • Element Detail

      • errorOnInvalidType

        boolean errorOnInvalidType
        True if a ClassCastException should be thrown when the current SecurityContext is the incorrect type. Default is false.
        Returns:
        whether or not to error on an invalid type
        Default:
        false
      • expression

        java.lang.String expression
        If specified, will use the provided SpEL expression to resolve the security context. This is convenient if applications need to transform the result. For example, if an application needs to extract its custom Authentication implementation, then it could specify the appropriate SpEL like so:
         @CurrentSecurityContext(expression = "authentication") CustomAuthentication authentication
         
        Returns:
        the expression to use
        Default:
        ""