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

Fix OAuth client to match the documentation and current api #168

Closed
wants to merge 1 commit into from

Conversation

guidozanon
Copy link

Remove AccessToken code and accept client_id & client_secret

@romerosilva-meli
Copy link
Contributor

Hi @guidozanon, how are you?

Thank you for your contribution. Unfortunately both methods to create oauth credentials (with access token and client id/client secret) are valid. In order to accept your contribution, I'll ask you to refactor your code and rewrite it as an overloaded method, keeping the original as is.

@guidozanon
Copy link
Author

Hey @romerosilva-meli, thanks for the reply. How is the current implementation match this documentation: https://www.mercadopago.com.ar/developers/es/reference/oauth/_oauth_token/post?

The current implementation does not receive the clientid/clientsecret to generate a token. Do you have an example of a working call with the current implementation? Maybe we are doing something wrong.

@romerosilva-meli
Copy link
Contributor

romerosilva-meli commented Aug 1, 2023

You're right, the current documentation does not reflect that implementation. It has to be updated.

You don't need to worry about the current implementation, you can keep it as is in the SDK, you can just copy your implementation into a new, overloaded method, like this:

// original method
public Task<OAuthCredential> CreateOAuthCredentialAsync(
            string authorizationCode,
            string redirectUri,
            RequestOptions requestOptions = null,
            CancellationToken cancellationToken = default)
        {
          ...
        }

// overloaded method with your implementation
public Task<OAuthCredential> CreateOAuthCredentialAsync(
            string authorizationCode,
            string clientId,
            string clientSecret,
            string redirectUri,
            RequestOptions requestOptions = null,
            CancellationToken cancellationToken = default)
        {
          ...
        }

@romerosilva-meli
Copy link
Contributor

Changes present in this branch were added to #169

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

Successfully merging this pull request may close these issues.

2 participants