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

Panic occurs when generating OAuth2 token with an invalid refresh token value #6724

Closed
Nuvindu opened this issue Jul 10, 2024 · 2 comments
Closed
Labels
Area/Client module/oauth2 Reason/Invalid Issue is invalid. Team/PCM Protocol connector packages related issues Type/Bug

Comments

@Nuvindu
Copy link
Contributor

Nuvindu commented Jul 10, 2024

Description:
When a gmail:Client is initialized with an invalid refresh token, a panic occurs instead of mapping the error value to the variable. That happens when oauth2 module tries to generate a token using that invalid refresh token value

Steps to reproduce:

  1. Create new Ballerina project
  2. Modify the main.bal file as below and run the project
import ballerinax/googleapis.gmail;

configurable string clientId = "client-id";
configurable string clientSecret = "client-secret";
configurable string refreshToken = "refresh-token";

public function main() {
    gmail:Client|error gmail = new ({
        auth: {
            clientId,
            clientSecret,
            refreshToken
        }
    });
}
@Nuvindu Nuvindu added Type/Bug module/oauth2 Team/PCM Protocol connector packages related issues Area/Client labels Jul 10, 2024
@Nuvindu Nuvindu changed the title Panic occurs when gmail:Client is initialized with an invalid refresh token Panic occurs when generating OAuth2 token with an invalid refresh token value Jul 10, 2024
@MohamedSabthar
Copy link
Member

Hi @Nuvindu, This is not a bug but a design choice. We already have an issue for this: #3494

@MohamedSabthar MohamedSabthar added the Reason/Invalid Issue is invalid. label Sep 11, 2024
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Client module/oauth2 Reason/Invalid Issue is invalid. Team/PCM Protocol connector packages related issues Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants