ArunPrakashG / valorant_client

Unofficial valorant client to interact with riot's valorant game api.
MIT License
6 stars 2 forks source link

macOS dio 403 error #5

Open yagizdo opened 2 years ago

yagizdo commented 2 years ago

Hi.

I wrote an app that works on both mobile and desktop using your package. It works on mobile without any problems, but when I run it on macOS, I get the following error. It used to work, then it suddenly broke (which I never updated the code). After that, it never worked again.

There is still no problem on mobile, it works without any problems, but when I run it as a macOS app, it does not work. I couldn't see any place about me from the error codes. Only 'client.init' showed the parts I made.

Error : image

If you want to examine my codes in detail, I leave my repo link.

Repo : https://github.com/yagizdo/valorant_store_checker

If you only want to see the methods I wrote about the client, etc., I put the link of that page directly below.

Account Provider codes : https://github.com/yagizdo/valorant_store_checker/blob/master/lib/providers/account_provider.dart

Frankly, I couldn't figure out what I did myself. I wanted to open an issue as there may be a problem with the client.

I wish have a nice day.

ArunPrakashG commented 2 years ago

Hi there! Response code 403 indicates that the authorization failed. Please check if the authorizations details such as user name and password are different on both devices.

yagizdo commented 2 years ago

Thank you very much for your reply.

I am almost sure that the account information is correct because I get the name and password from the password manager I use. But when you said it, I wanted to check it again. I deleted the existing account and got my name and password from the password manager again.

But the error is still the same. When I do this in the mobile app, there is no problem. But when I do it in macos app, I get an same error :/

ArunPrakashG commented 2 years ago

On another project which I worked on, there is a case in which the iOS device replaces normal quotes (special characters) with their own OS specific ones. You can disable this behavior with smartQuotesType property on text fields.

Please check if this is the cause in your case.

yagizdo commented 2 years ago

Thank you for your answer. I disabled this option in both the username and password textfields. But the error is still the same, nothing has changed :/

Screen Shot 2022-06-20 at 17 18 01

ArunPrakashG commented 2 years ago

Unfortunately, I do not have a mac to test this case on. I think from the screenshots, you have VS Code right ? If possible, could you please use breakpoints just above the authorization call and then enable the debug my code + packages option and step through the flow and see where it actually breaks ?

This would of great help in order to resolve the case. 1

yagizdo commented 2 years ago

Normally I was using intelliJ idea, but that's okay, I can try it on vs code.

Where exactly do I open the setting you mentioned? And do I need to do anything additional after turning it on? Or do I just run and test my application again?

ArunPrakashG commented 2 years ago

Thank you for your help. First off, you will need to create a launch configuration for the project. first

Once the file is created, add "flutterMode": "debug" on the main app configuration, which is usually the first in the array.

after that, press F5 to launch the app in debug mode, then you can see second a bar similar to the above in your VS Code, in there, click on Debug my code and change it to Debug my code + packages this will help you step through code of external packages.

once this is done, add a breakpoint right away the authorization method call and step through and check where the function is breaking.

yagizdo commented 2 years ago

I hope I've spelled correctly. I added the setting as you said and ran it in debug mode. This was the first place that exploded when I clicked on Account.

image

ArunPrakashG commented 2 years ago

Thanks for the debug data! On the right side, you can see the dio instance state. there, when you check on response property, you can see error code 1020. I think the problem you are facing is related to firewall. Since the requests are same, on both platforms, i think it may not be a problem from the library itself.

image

Read more about it here: Error Code 1020

Also, to confirm this is the case, you can manually create an authorization flow using post man, and then check if you get the same response.

yagizdo commented 2 years ago

Thank you very much for your reply!

But I don't use any security program etc on macos. But I'll still check. It seems strange to me that it works on iOS and not macOS. I never thought it was due to your library. I just wanted to open an issue just to be sure.

But I guess it won't dissolve :/

Thank you for answering and helping. Also, thank you for providing such a package to the community!

ArunPrakashG commented 2 years ago

As of now, the best solution for you is to use Postman and reference this document to understand the authorization flow and manually send the required requests from postman and check if you still face the same problem on the mac.

https://github.com/techchrism/valorant-api-docs/blob/trunk/docs/Riot%20Auth/readme.md

EmreKabali commented 1 year ago

Hi guys,

I think problem still continue for me. I tried both of them (MacOs and Windows) but result is same : Http status error [403]

Gex-devs commented 1 year ago

This error persists on Android as well now.