![]() ![]() Mosseri also stated that several basics are still missing from the app, such as the ability to search hashtags. You need to provide a few values to set this up such as your Instagram Client ID and Secret and the Instagram’s OAuth 2.0 token and authorization endpoints.Other features that Mosseri noted are “on the list” include the ability to switch between different Threads accounts and the option to edit posts. On the server we’ll be using the simple-oauth2 package which helps with hiding the details of the OAuth 2.0 protocol. This is a typical step you’ll have to make with every OAuth 2.0 providers: register your app and whitelist callback URLs in return for a Client ID and Secret. Now take note of your Instagram Client ID and Client Secret. In your Instagram app’s configuration make sure you have whitelisted (for testing) and (your production domain) as valid redirect URIs. ![]() Before we do this you’ll first need to register your application on the Instagram Developers console so that we can get your app credentials which are needed for OAuth 2.0. You’ll need to add a button on your web app which starts the Instagram auth flow. ![]() Let’s now go into a bit more details and look at how to implement the key points of this integration. Once done we close the popup and Voila! your user is signed into Firebase with profile data from their Instagram account. We’ll also pass the user profile information that we got from Instagram such as the display name and the photo URL so that we can update the Firebase profile on the client - Note: Instagram does not provide the email of the user so we we’ll have a Firebase account without an email, which is fine. This token will allow the user to sign-in into Firebase in our web app using the signInWithCustomToken method. On the server, once we have fetched the Instagram user information, we’ll create a Firebase custom auth token. In the process of exchanging the auth code, Instagram will also return the user identity (this sometimes requires an additional request with other OAuth 2.0 providers like LinkedIn). The auth code can be exchanged server side for an access token using your Instagram app’s credentials. We’ll do that in a popup window.Īfter authorizing your app, users will be redirected back to your domain with an auth code. Here is how the OAuth 2.0 flow goes:įirst the user needs to be redirected to the authorization endpoint of Instagram which will present the user with a consent screen the first time they are asked to grant access to your app. You need to have the user go through the OAuth 2.0 auth code flow and grant access to your app. Instagram supports OAuth 2.0 as its main way to authorize apps and access user data which includes the Instagram user’s identity. Instagram uses OAuth 2.0 for sign-in, so this post should help you integrate with other OAuth 2.0 identity providers such as LinkedIn as well. Let’s walk through the steps required to integrate Instagram Sign-In in a Firebase web app. Using Identity Providers for which Firebase doesn’t have built-in support is possible, but requires a bit more code, and a server. For example, Instagram can be a nice alternative especially if you plan on also using the Instagram API to let users share their Instagram photos. However you may be interested in using other Identity Providers to let your users sign into your Firebase app. For example, in a web app all you need to sign in your Firebase users with Google is: var google = new firebase. Firebase Authentication supports four federated Identity Providers out-of-the-box, making it super easy to authenticate with Google, Facebook, Twitter and GitHub. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |