basic authentication

415 views
Skip to first unread message

david...@gmail.com

unread,
Dec 11, 2017, 5:36:45 PM12/11/17
to Flutter Dev
i would like to perform a basic authentication with a simple token; how to perform this in flutter?  which is the best way? 

var response = await httpClient.post(url, body: {'name': 'doodle', 'color': 'blue'});

is it sufficient to ad an authentication header, for example in this way ?

var response = await httpClient.post(url, header:{ 'authorization' : 'basic $token', 'content-type':'application/json'},body :{some body});

thanks in advance

david...@gmail.com

unread,
Dec 11, 2017, 6:08:03 PM12/11/17
to Flutter Dev
PS : i would like to use a jwt type token

Ian Hickson

unread,
Dec 11, 2017, 6:12:20 PM12/11/17
to david...@gmail.com, Flutter Dev
This is more of a generic Dart question. I encourage you to ask such questions on Stack Overflow or other programming help forums for Dart.

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

--
Ian Hickson

😸

yegor.jbanov

unread,
Dec 12, 2017, 5:46:59 PM12/12/17
to Flutter Dev
Another good source is https://pub.dartlang.org itself. It has a number of packages dealing jwt (disclaimer: I've never used them myself).

david...@gmail.com

unread,
Jan 8, 2018, 5:18:34 PM1/8/18
to Flutter Dev
Thanks for your kind answer :) i finally managed to resolve my problem using Futures as shown in the Flutter documentation
Reply all
Reply to author
Forward
0 new messages