I want wsse header generated in flutter like this https://doc.oroinc.com/api/authentication/wsse/
-
I think this will send you in the correct direction stackoverflow.com/questions/53299447/flutter-http-headersEli Front– Eli Front2020-07-30 03:05:00 +00:00Commented Jul 30, 2020 at 3:05
-
Thanks. But it doesn't. I need to create nonce, and pasword digest for header.Ujwal Basnet– Ujwal Basnet2020-07-30 05:34:22 +00:00Commented Jul 30, 2020 at 5:34
Add a comment
|
1 Answer
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);
3 Comments
Ujwal Basnet
I mean I want to generate password digest and nonce in this way forum.oroinc.com/oro-platform/how-do-i-questions/topic/…
Yadhu
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
Ujwal Basnet
But I have the api that has wsse authentication. So need this :D