Skip to content

403 Forbidden Error - Token issues #23

@chris84948

Description

@chris84948

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions