Skip to content
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

403 Forbidden Error - Token issues #23

Open
chris84948 opened this issue Oct 24, 2022 · 0 comments
Open

403 Forbidden Error - Token issues #23

chris84948 opened this issue Oct 24, 2022 · 0 comments

Comments

@chris84948
Copy link

Hey, I'm using this library and I think something is going wrong with the token that's generated from generateJWT().

I've got all the data in the JWT constructor matching what you've got in the example, but every time I try it, I get a 403 forbidden (access denied) error.

I tried another example in c#, using the same teamID/keyID/private key etc, and the token string it generates works. I can use that token in the dart sample I'm working on, so I know everything else is good except for the token generated in Dart.

I don't really have a lot of experience with JWTs or tokens, so I fully believe I've done something wrong here, but don't know what?

var jwtToken = weather.generateJWT(bundleId: "OpenSkyWeatherKit", teamId: "54P****GDC", keyId: "HL******39", pem: pem, expiresIn: const Duration(hours: 1));
var data = await weather.obtainWeatherData(jwt: jwtToken, language: "en", latitude: 44.96, longitude: -93.39, dataSets: DataSet.forecastDaily, timezone: 'America/Chicago');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@chris84948 and others