首页 > 解决方案 > FLUTTER How to implement Digest Authentification

问题描述

to implement a normal HTTP Request is very easy. But to implement a Digest Authentification I do not really know how to implement.

In the best case you can discribe it for Flutter but I do not mind if it is in another language.

Thank You!

标签: httpauthenticationflutterdigest-authentication

解决方案


DartHttpClient支持摘要。如果您事先知道领域,请addCredentials在提出请求之前致电。如果没有,请实现authenticate回调,它将把方案和领域传回给你。然后,您应该addCredentials从回调的实现中调用。

您仍然可以通过将其package:http与, 一起使用:HttpClient

  HttpClient authenticatingClient = HttpClient();
  authenticatingClient.addCredentials(url, realm, credentials);
  http.Client client = http.IOClient(authenticatingClient);

推荐阅读