-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect using JWT #378
Comments
It is normal for me to put the token in headers, you can refer to my code:
|
I tired to following but still not working
|
Then the problem should be on the server side, please check the server side code |
I don't think the problem is with server side as it work without any problem with Postman and C# client code using web sockets. |
It should be that your postman has some special configuration that your dart code doesn't have. Pay attention to the content-type setting
|
Using this code does work
The code that cause the problem and confusion is the following that the Error is not capture in try..catch block for using
|
I observe the following code, what is the value of your status.goingAway?
|
status.dart from web_socket_channel give the option of 1001 that is const goingAway = 1001; so I don't understand if utils.dart allow only 1000 or range of 3000-4999 why status.dart give the option of status 1001 to status 1015? |
Use this: import 'package:web_socket_channel/io.dart';
_channel = IOWebSocketChannel.connect(
url,
headers: {
'Authorization': 'Bearer $apiKey',
},
); |
Hi,
My Server side code is SignalR and I am unable to connect to it if I am using JWT. if I am not using JWT at server side, I am able to connect.
I am able to connect without any problem with same approach as my following Flutter code when using Postman and C# client code using web sockets.
My Flutter code:
Also the following code does not return any error and channel object is empty:
For some reason I am able to add sink's like so:
Error will raise without any location where it is when trying to listen:
But
onError: (error) => debugPrint('Error: ' + error)
is not triggered.Thanks for any help,
AG
The text was updated successfully, but these errors were encountered: