-3

I need to turn the XML configuration into java how can I do for this part please

<security:http entry-point-ref="samlEntryPoint">
    <security:intercept-url pattern="/**"
        access="IS_AUTHENTICATED_FULLY" />
    <security:custom-filter before="FIRST"
        ref="metadataGeneratorFilter" />
    <security:custom-filter after="BASIC_AUTH_FILTER"
        ref="samlFilter" />
</security:http>

I tried this but i got some error

.anyRequest().access("IS_AUTHENTICATED_FULLY");

Failed to evaluate expression IS_AUTHENTICATED_FULLY

Thanks

liams62217
  • 165
  • 2
  • 7

1 Answers1

0

Use http.authorizeRequests().antMatchers("/**").fullyAuthenticated()

Babl
  • 7,446
  • 26
  • 37
  • 1
    While this may answer the question, it is better to provide an explanation to your answer. – Mickael Feb 14 '18 at 09:43
  • @MickaëlB This code is self-explanatory. There is no need to explain here anything. This is just a translation of XML into java :) – Babl Feb 14 '18 at 11:12
  • Your answer doesn't provide any information about why he gets an error in the first place and why your answer will solve his problem. So I don't think it's *"self-explanatory"*... – Mickael Feb 14 '18 at 11:20
  • I tried but it does not work because in AuthenticatedVoter [ org.springframework.security.access.vote ] the class use IS_AUTHENTICATED_FULLY – liams62217 Feb 14 '18 at 12:44