dreampowder / strava_flutter

Flutter package to use Strava v3 API
Other
37 stars 52 forks source link

redirect_uri invalid #100

Closed tmauricio closed 1 year ago

tmauricio commented 1 year ago

when opening the website with the login of strava the following message appears:

{"message: "Bad Request", "errors": [{"resource": Application", "field": "redirect_uri", "code": "invalid"}]}

The code is:

Future stravaConnect(context) async { final String stravaSecret = AppConfig().config.strava["secret"]; final String stravaClientId = AppConfig().config.strava["clientId"]; final stravaClient = StravaClient(secret: stravaSecret, clientId: stravaClientId);

StravaService(stravaClient).testAuthentication(
  [
    AuthenticationScope.profile_read_all,
    AuthenticationScope.read_all,
    AuthenticationScope.activity_read_all
  ],
  "stravaflutter://redirect"
).then((value) {
  print("devolucion login strava");
  print(value);
});

}

class StravaService { final StravaClient stravaClient; StravaService(this.stravaClient) {}

Future testAuthentication( List scopes, String redirectUrl) { return stravaClient.authentication.authenticate( scopes: scopes, redirectUrl: redirectUrl, forceShowingApproval: false, callbackUrlScheme: "stravaflutter", preferEphemeral: true ); }

Future testDeauthorize() { return stravaClient.authentication.deAuthorize(); }

}

dreampowder commented 1 year ago

@tmauricio so i guess you fixed this issue on your own side? 😅

tmauricio commented 1 year ago

Yeah, I was able to fix it, it was a layer 8 problem, ha! Thanks anyway.

dreampowder commented 1 year ago

that's good news, enjoy!