-
-
Notifications
You must be signed in to change notification settings - Fork 8
Authorization
Spotify4Unity supports some of the authorization types available in SpotifyAPI-NET.
When you set your Authorization Type
on the SpotifyService
, you need to add the related Auth Config
component to the same file. The config allows you to adjust the auth method with some options.
On every config, you can adjust the Redirect URI
property and the Port
used. If you change the Port
, you need make sure the Redirect URI
is updated with the new port.
For example, if I set the Port
to 7777
, then the Redirect URI
should be http://localhost:7777/callback
Requires the PKCE_AuthConfig
script component next to the SpotifyService
. PKCE is the recommended method as it requires single authorization from the user and can be refreshed without user input. The token can also be saved either in a file or in PlayerPrefs
and loaded within the next session, without user input.
Spotify Documentation: PKCE
Requires the ImplicitGrant_AuthConfig
script component next to the SpotifyService
. This method contains no additional configuration
Spotify Documentation: Implicit Grant
Requires the ClientCredentials_AuthConfig
script component next to the SpotifyService
. This method requires your client secret id
Spotify Documentation: Client Credentials