Closed tmauricio closed 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(); }
@tmauricio so i guess you fixed this issue on your own side? 😅
Yeah, I was able to fix it, it was a layer 8 problem, ha! Thanks anyway.
that's good news, enjoy!
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);
}
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();
}
}