I want wsse header generated in flutter like this https://doc.oroinc.com/api/authentication/wsse/
Asked
Active
Viewed 188 times
0
-
I think this will send you in the correct direction https://stackoverflow.com/questions/53299447/flutter-http-headers – Eli Front Jul 30 '20 at 03:05
-
Thanks. But it doesn't. I need to create nonce, and pasword digest for header. – Ujwal Basnet Jul 30 '20 at 05:34
1 Answers
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
-