romanzipp / Laravel-Twitch

Twitch Helix API PHP Wrapper for Laravel
https://packagist.org/packages/romanzipp/laravel-twitch
MIT License
108 stars 18 forks source link

Subscribe Follow Endpoint #148

Closed CodeWizardTV closed 1 year ago

CodeWizardTV commented 1 year ago

Hi,

when i try to subscribe tot channel.follows endpoint i get the message "subscription missing proper authorization". Where do i define scopes for the OAuth-Generator?

Kind regards,

Ron

romanzipp commented 1 year ago

According to the EventSub Docs you need to request the moderator:read:followers scope. The second parameter of the getOAuthAuthorizeUrl method is an array of scopes to be requests from the user in the OAuth flow.

public function getOAuthAuthorizeUrl(
  string $responseType = 'code', 
  array $scopes = [], 
  string $state = null, 
  bool $forceVerify = false
): string
CodeWizardTV commented 1 year ago

Sorry i've meant for the auto generated oauth.

Wouldn't it be good to also define which scopes should be used for it in the twitch-api.php

f.e.:

` 'oauth_client_credentials' => [ /*

. . . `

romanzipp commented 1 year ago

The auto generate feature only works for the OAuth Client Credentials flow which does not support scopes

CodeWizardTV commented 1 year ago

Oh ok i see. So i have to manage the User OAuth Flow by myself.

Thanks for your help and nice work!