View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.1.1
- Last updated
- First released
- Unity version
- 2021.3.43 or later
- Package size
- 65 KB
- Files
- 13
- Favorites
- 8
- Views in the past week
- 5
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $10.99 on
Keywords
Login With Twitch - Authentication made easy
Let your users easily login using their Twitch Account
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 2
Login With Twitch - Authentication made easy screenshot 1
About this asset
If you want to integrate your game with twitch, for example to use our Twitch PubSub & Chat Integration, this asset can help you to create an easy login function for your players so you do not need to send them to cryptically looking token generation sites.
Logging in with a twitch account into your game works just as with any website:
- Click the login button
- A browser window will be opebend
- Logging in to twitch (if not already logged in)
- Granting authorization by confirming the security question from twitch
- Browser can be closed
- Game is logged in
To achieve this, our asset supports three login methods:
A) Implicit Grant Flow
B) Authorization Code Flow (Local)
C) Server-Assisted Authorization Code Flow (recommended solution)
Please review the technical details regarding advantages and disadvantages of each method!
When letting the user log in, you can decide to force a re-authentication, which is useful for swichting accounts (Bot Account). Further you can eighter manually specify any required scopes by name, or you can pick one (or more) from our predefined scope sets for common things like chatbots.
Utilizing login methods B or C, this asset can maintain a valid token by refreshing it automatically when its expiring or when the game is restarted.
All Methods allow you to get basic information about who logged in (login name, userID) without manually talking to twitch's APIs. You can however use the token reeturned from our asset to request any information using a UnityWebRequest against twitch's API of course!
This asset, can be used in multiple instances, so you could for example login a streamer and his bot account in parallel. This requires some minor additional precautions (different game objects, port numbers, ...).
This asset does not support web platforms (WebGL). On a website, you should authenticate the user using your hosting website and pass the token to the game.
From the publisher's Asset Store listing.
Technical details
A) Implicit Grant Flow
This allows for generating a temporary token.
Advantage: This is a secure implementation
Downside: It requires JavaScript support in the player's browser (what is commonly available)
B) Authorization Code Flow (Local)
The user authorizes your application to get a token and the application then requests that token form twitch.
Advantage: Tokens can be refreshed without user interaction
Downside: You must include the ClientSecret in your game - This is considered a bad practice and a security risk
C) Server-Assisted Authorization Code Flow (recommended solution)
Same as B but the secret is not added to the game, instead a small PHP-based script must be made available somewhere. (You can Re-implement the service in any language on your own)
Advantage: Same as B and the client secret is stored securely and only on your server
Disadvantage: You need to have a website, server or a cloud instance somewhere, where you can install the PHP-Script.
Want to know more? Visit our online documentation HERE
As always, the full source code is included with this asset so you can customize it if needed.
This asset does not support web platforms (WebGL)
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 2021.3.43f1 | Compatible | Compatible | Compatible | Compatible |
As listed on the Asset Store.