Dart Client -> onAuthenticationRequired not on interface

Hi

In the latest release notes, we noticed the recommended way to initialise the IServiceClient.

    kDebugMode
  ? ClientFactory.createWith(ClientOptions(baseUrl:'https://dev.servicestack.com:5001', ignoreCert:true))
  : ClientFactory.create("https://prod.app")

Before that we used the JsonServiceClient directly.

What i noticed now is that we are missing onAuthenticationRequired on the Interface.
Since we use it to redirect to the login screen and as far as i can see all implementations of IServiceClient support that, could you add AsyncCallbackFunction onAuthenticationRequired; to the IServiceClient.

Thank you

Done, available in v1.0.21+.

Perfect. Thank you for the fast resolution.

1 Like

I found another missing method on the interface: `createUrlFromDto’ which we also use.
sorry that i missed that one on the initial request, but it should be all now for us.

Utility methods don’t belong on the interface so I’ve consolidated them as extension methods on IServiceClient instead. This change is available from 1.0.22 no on pub.

Note: Dart extension methods requires at least Dart 2.7.

with the newest feature we are working on, we take a look into request filters on the client.
I saw now that those are also missing on the interface.

I gathered now the list of properties which both jsonWebClient and JsonServiceClient have in common.
Couldn’t all of them be on the interface?
For me it sounds legit that they are on the interface

  Map<String, String> headers;
  String refreshTokenUri;
  List<Cookie> cookies;
  RequestFilter requestFilter;
  ResponseFilter responseFilter;
  static RequestFilter globalRequestFilter;
  static ResponseFilter globalResponseFilter;
  UrlFilter urlFilter;
  ResponseExceptionFilter exceptionFilter;
  static ResponseExceptionFilter globalExceptionFilter;

the statics could be ignored but are also on both implementations.

No the filters are incompatible as they’re passed different concrete http client implementations (HttpClientRequest vs Request), you’ll need to cast to JsonServiceClient or JsonWebClient to access the filters of each Service Client.

ok thx for the fast reply