Login With Twitch - Authentication made easy
Firesplash Entertainment
$10.99
(no ratings)
Jump AssetStore
Let your users easily login using their Twitch AccountIf 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 buttonA browser window will be opebendLogging in to twitch (if not already logged in)Granting authorization by confirming the security question from twitchBrowser can be closedGame is logged inTo achieve this, our asset supports three login methods:A) Implicit Grant FlowB) 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.A) Implicit Grant FlowThis allows for generating a temporary token.Advantage: This is a secure implementationDownside: 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 interactionDownside: You must include the ClientSecret in your game - This is considered a bad practice and a security riskC) 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 serverDisadvantage: 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 HEREAs 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)