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

AccountV1().GetByAccessTokenAsync resulting in 400 #94

Open
brbarnett opened this issue Oct 17, 2022 · 3 comments
Open

AccountV1().GetByAccessTokenAsync resulting in 400 #94

brbarnett opened this issue Oct 17, 2022 · 3 comments

Comments

@brbarnett
Copy link

I am calling this endpoint as:

var account = await this._riotClient.AccountV1().GetByAccessTokenAsync(
    RegionalRoute.AMERICAS,
    $"Bearer {accessToken}",
    cancellationToken);

I receive a 400 as a result. I believe this is due to also including the api_key in the resulting call, because I see that behavior from postman as well. Here's what is working and isn't working for me locally:

Not working:
GET https://americas.api.riotgames.com/riot/account/v1/accounts/me?api_key=RGAPI-136f0.................
Headers: { Authorization: "Bearer eyJ6aXAiOiJERUYiLCJraWQiO..." }

Working:
GET https://americas.api.riotgames.com/riot/account/v1/accounts/me (no api_key)
Headers: { Authorization: "Bearer eyJ6aXAiOiJERUYiLCJraWQiO..." }

@brbarnett
Copy link
Author

Upon further review, given that Camille auto-generates endpoints based on Riot's documentation, I think this is actually a Riot API problem instead of Camille. If their documentation https://developer.riotgames.com/apis#account-v1/GET_getByAccessToken correctly excluded the API Key in the request, I believe Camille would consume that correctly and it would work as intended. Will follow up with DevRel

@MingweiSamuel
Copy link
Owner

MingweiSamuel commented Oct 17, 2022

Keeping this open, upstream issues or how we handle the upstream data from https://github.com/MingweiSamuel/riotapi-schema

@MingweiSamuel MingweiSamuel reopened this Oct 17, 2022
@MingweiSamuel
Copy link
Owner

Will probably need to add a list of non-api-key endpoints to riotapi-schema and handle it in the codegen here accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants