adamdburton/destiny-2-api-client

Unable to authenticate with public application

Opened this issue · 2 comments

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
]);
}

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