0

I want wsse header generated in flutter like this https://doc.oroinc.com/api/authentication/wsse/

1 Answers1

0

have never used those APIs, but here is generalised idea which default Dart libraries and i am doing a GET here, change it according to your needs

  var g = await HttpClient().getUrl(url);
  g.headers.set('Content-Type', 'application/vnd.api+json');
  g.headers.set('Authorization', 'WSSE profile="$usernameToken"');
  g.headers.set('X-WSSE', '''
        UsernameToken Username="$admin",
        PasswordDigest="$passworddigest",
        Created="$date",
        Nonce="$nonce"
  ''');
  var r = await g.close();
  //r is a stream
  //read the response body as string
  String body = await utf8.decodeStream(r);
Yadu
  • 2,979
  • 2
  • 12
  • 27
  • I mean I want to generate password digest and nonce in this way https://forum.oroinc.com/oro-platform/how-do-i-questions/topic/generate-api-wss-header-for-kotlin/ – Ujwal Basnet Jul 30 '20 at 04:59
  • the document you have mentioned tells that the authentication method you are trying to do is depreciated, and it tells you to use Oauth2, which way much easier to implement on client side – Yadu Jul 30 '20 at 05:08
  • But I have the api that has wsse authentication. So need this :D – Ujwal Basnet Jul 30 '20 at 05:35