You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my use-case, the default bool basicAuth = true parameter causes a problem, because AWS Cognito refuses such requests with a 400 { "error": "invalid_client" } code. See source.
I would suggest extending the OAuthChopper.refresh() method to include all optional parameters of the wrapped oauth2.Credentials.refresh() method:
Future<OAuthToken?> refresh({bool basicAuth =true, Iterable<String>? newScopes}) async {
final credentialsJson =await _storage.fetchCredentials();
if (credentialsJson ==null) returnnull;
final credentials = oauth2.Credentials.fromJson(credentialsJson);
try {
final newCredentials =await credentials.refresh(
identifier: identifier,
secret: secret,
httpClient: httpClient,
basicAuth: basicAuth,
newScopes: newScopes,
);
await _storage.saveCredentials(newCredentials.toJson());
returnOAuthToken.fromCredentials(newCredentials);
} on oauth2.AuthorizationException {
_storage.clear();
rethrow;
}
}
The text was updated successfully, but these errors were encountered:
Thanks for the feedback! Initially I only implemented the parameters needed for our own use-cases.
I have extended oauth_chopper to support more of the auth2 package parameters in #25. Including the extra refresh parameters. Hopefully this solves your problem.
The default code for
OAuthChopper.refresh()
callsoauth2.Credentials.refresh()
with these parameters:In my use-case, the default
bool basicAuth = true
parameter causes a problem, because AWS Cognito refuses such requests with a400 { "error": "invalid_client" }
code. See source.I would suggest extending the
OAuthChopper.refresh()
method to include all optional parameters of the wrappedoauth2.Credentials.refresh()
method:The text was updated successfully, but these errors were encountered: