Github user MegaAlex commented on a diff in the pull request:

    https://github.com/apache/fineract/pull/374#discussion_r133807224
  
    --- Diff: 
fineract-provider/src/main/resources/META-INF/spring/securityContext.xml ---
    @@ -42,19 +42,26 @@
                                method="POST" requires-channel="https" />
                        <intercept-url pattern="/api/*/self/registration/user" 
access="permitAll"
                                method="POST" requires-channel="https" />
    -                   <intercept-url pattern="/api/**" 
access="isFullyAuthenticated()"
    +                   <intercept-url pattern="/api/*/twofactor" 
access="isFullyAuthenticated()"
    +                                              method="GET" 
requires-channel="https" />
    +                   <intercept-url pattern="/api/*/twofactor" 
access="isFullyAuthenticated()"
    +                                              method="POST" 
requires-channel="https" />
    +                   <intercept-url pattern="/api/*/twofactor/validate" 
access="isFullyAuthenticated()"
    +                                              method="POST" 
requires-channel="https" />
    +                   <intercept-url pattern="/api/**" 
access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
                                method="GET" requires-channel="https" />
    -                   <intercept-url pattern="/api/**" 
access="isFullyAuthenticated()"
    +                   <intercept-url pattern="/api/**" 
access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
    --- End diff --
    
    In the implementation I am proposing, I look at 2fa as an authorisation 
problem. Users that are two-factor authenticated are granted the 
_TWOFACTOR_AUTHENTICATED_ authority. Endpoints under _/twofactor_ and 
_/twofactor/validate_ don't require fully authenticated uses, thus no need to 
check for TWOFACTOR_AUTHENTICATED.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to