adamdburton / destiny-2-api-client

PHP API client for Destiny 2
MIT License
11 stars 8 forks source link

Unable to authenticate with public application #9

Open Nazalas opened 5 years ago

Nazalas commented 5 years ago

I am not sure if this is an issue with the package, the api, or my code but I am unable to get an access token on a public destiny app. Here is my error

Request error (invalid_request): Public client should not attempt to authenticate.

I tested and added this method to Api\Module\App.php and it seems to work.

public function getAccessTokenFromAuthCodePublic($authCode, $oAuthClientId) { return $this->apiClient->postAsForm('App/OAuth/Token', [ 'client_id' => $oAuthClientId, 'grant_type' => 'authorization_code', 'code' => $authCode ]); }

adamdburton commented 5 years ago

@Nazalas I believe you need to make a 'private' client instead of a 'public' client on the https://www.bungie.net/en/Application site.

Nazalas commented 5 years ago

That is what I have done but do you not support public clients as well?

On Wed, Sep 4, 2019 at 12:44 PM Adam Burton notifications@github.com wrote:

@Nazalas https://github.com/Nazalas I believe you need to make a 'private' client instead of a 'public' client on the https://www.bungie.net/en/Application site.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adamdburton/destiny-2-api-client/issues/9?email_source=notifications&email_token=ABGGN62KRSCGJD45AF7GWQLQH7QVNA5CNFSM4ITTZDHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD54G23Q#issuecomment-527986030, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGGN67RDW5XIOLT3NMMO4DQH7QVNANCNFSM4ITTZDHA .