anchor.diff:      ENDIF.
   
       IF lv_user <> lv_default_user.
  -      lcl_app=>user( )->set_repo_username( iv_url = iv_url iv_username = lv_user ).
  -    ENDIF.
  -
  -    ii_client->authenticate(
  -      username = lv_user
  -      password = lv_pass ).
  +      lcl_app=>user( )->set_repo_username( iv_url      = iv_url
  +                                           iv_username = lv_user ).
  +    ENDIF.
  +
  +    lv_scheme = ii_client->response->get_header_field( 'www-authenticate' ).
  +    FIND REGEX '^(\w+)' IN lv_scheme SUBMATCHES lv_scheme.
  +
  +    CASE lv_scheme.
  +      WHEN 'Digest'.
  +* https://en.wikipedia.org/wiki/Digest_access_authentication
  +* eg used by https://www.gerritcodereview.com/
  +        lcl_http_digest=>run(
  +          ii_client   = ii_client
  +          iv_username = lv_user
  +          iv_password = lv_pass ).
  +      WHEN OTHERS.
  +* https://en.wikipedia.org/wiki/Basic_access_authentication
  +        ii_client->authenticate(
  +          username = lv_user
  +          password = lv_pass ).
  +    ENDCASE.
   
     ENDMETHOD.  "acquire_login_details
   
  
positive.code:     " Disable internal auth dialog (due to its unclarity)
      ri_client->propertytype_logon_popup = if_http_client=>co_disabled.
  
      lv_expect_potentual_auth = boolc(
        lcl_login_manager=>load( iv_uri    = iv_url
                                 ii_client = ri_client ) IS INITIAL ).
  
      send_receive( ri_client ).
      IF lv_expect_potentual_auth = abap_true
          AND check_auth_requested( ri_client ) = abap_true.
        acquire_login_details( ii_client = ri_client
                               iv_url    = iv_url ).
        send_receive( ri_client ).
  
negative.code:   ENDMETHOD.  "check_auth_requested
  
    METHOD acquire_login_details.
  
      DATA: lv_default_user TYPE string,
            lv_scheme       TYPE string,
            lv_user         TYPE string,
            lv_pass         TYPE string.
  
  
      lv_default_user = lcl_app=>user( )->get_repo_username( iv_url ).
      lv_user         = lv_default_user.
  
      lcl_password_dialog=>popup(
  