FLUTTER How to implement Digest Authentification

微笑、不失礼 提交于 2021-01-28 05:58:45

问题


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!


回答1:


The Dart HttpClient supports digest. If you know the realm in advance, call addCredentials before making the request. If not, implement the authenticate callback which will pass the scheme and realm back to you. You should then call addCredentials from your implementation of the callback.

You can still use package:http with an HttpClient, by passing it in:

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


来源:https://stackoverflow.com/questions/56022844/flutter-how-to-implement-digest-authentification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!