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

Exception throwed when refreshing token #53

Open
LuigiVessella opened this issue May 14, 2024 · 0 comments
Open

Exception throwed when refreshing token #53

LuigiVessella opened this issue May 14, 2024 · 0 comments

Comments

@LuigiVessella
Copy link

LuigiVessella commented May 14, 2024

I'm working on my web app and I'm using this plugin to implement oauth2 login.
Login and logout are working fine but when i call my refresh() function:
`Future<AuthorizationResponse?> refresh() async {
if (discoveryDocument == null) {
await _fetchConfiguration(); // Recupera la configurazione se necessario
}

RefreshRequest request = RefreshRequest(
  
    clientId: clientId,
    scopes: ["openid", "profile", "email"],
    refreshToken: identity!.refreshToken!,
    configuration: discoveryDocument!,
    autoRefresh: true);

try {
  final response = await OpenIdConnect.refreshToken(request: request);

  identity = response;

  _isLogged = true;
  return response;
} on Exception catch (e) {
  throw Exception('Error during refresh OpenID Connect: $e');
}

}i got this error:Error: Exception: Error during refresh OpenID Connect: Request Failed: [error: request_failed, description: invalid_client: Invalid client or Invalid
client credentials]
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3 throw
packages/greenway/services/network/logger_web.dart 85:7 refresh
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31 `

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

1 participant