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

Mollie api key is not start with access now #405

Closed
shuizhugeju opened this issue Nov 11, 2024 · 2 comments
Closed

Mollie api key is not start with access now #405

shuizhugeju opened this issue Nov 11, 2024 · 2 comments

Comments

@shuizhugeju
Copy link

shuizhugeju commented Nov 11, 2024

 protected void ValidateApiKeyIsOauthAccesstoken(bool isConstructor = false) {
       string apiKey = _mollieSecretManager.GetBearerToken();
       **if (!apiKey.StartsWith("access_")) {**
           if (isConstructor) {
               throw new InvalidOperationException(
                   "The provided token isn't an oauth token. You have invoked the method with oauth parameters thus an oauth accesstoken is required.");
           }

           throw new ArgumentException("The provided token isn't an oauth token.");
       }
   }
@Viincenttt
Copy link
Owner

What kind of authentication are you using? An API key or an OAuth token? And are you setting testmode to true?

This error often occurs when you are trying to use an API key and setting testmode to true. You don't need to set the testmode parameter when using an API key, since the API key is either a test or prod API key.

@Viincenttt
Copy link
Owner

Closed due to inactivity

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

2 participants