- Python Social Media Analytics
- Siddhartha Chatterjee Michal Krystyanczuk
- 414字
- 2021-07-15 17:24:56
Application authentication
Application authentication is a form of authentication where the application makes API requests on its own behalf, without a user context. API calls are often rate limited per API method, but the pool each method draws from belongs to your entire application at large, rather than from a per-user limit.
For the purposes of social media analysis, we will use in most cases application authentication by creating an application on each social media platform that will query the related API.
There are several steps that are required to put in place a client with OAuth authorization:
- Creating a user/developer account: First of all, you have to register a user/developer account and provide personal information such as a valid email address, name, surname, country, and in many cases a valid telephone number (the verification process is done by sending you a text message with a code).
- Creating an application: Once you create your account, you will have access to a dashboard, which is very often called a developer console. It provides all the functionalities to manage your developer account, create and delete applications, or monitor your quota. In order to obtain access credentials you will have to create your first application via this interface.
- Obtaining access tokens: Then, you generate access tokens for your application and save them in a safe place. They will be used in your code to create an OAuth connection to the API.
- Authorizing HTTP requests (optional): Some APIs require HTTP request authorization, which means that a request has to contain an additional authorization header that provides the server with information about the identity of the application and permission scope.
- Setting up permission scopes (optional): Some APIs have the notion of multilevel permissions. In that case when you generate your API key you need to specify the scope for the key. Scope here refers to a set of allowed actions. Therefore, in cases where an application attempts an action that is out of its scope, it will be refused. This is designed as an additional security layer. Ideally one should use multiple API keys, each with restricted scopes, so that in the scenario where your API key is hijacked, due to the restrictions in its scope the level of potential harm is restricted.
- Connecting to the API using obtained access tokens: When all the preceding steps are configured, you can make requests using your access tokens. Now, the only limitation is the request quota, which depends on each platform.
推薦閱讀
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Java程序設(shè)計(jì)(慕課版)
- Boost程序庫(kù)完全開(kāi)發(fā)指南:深入C++”準(zhǔn)”標(biāo)準(zhǔn)庫(kù)(第5版)
- LabVIEW程序設(shè)計(jì)基礎(chǔ)與應(yīng)用
- Android Studio Essentials
- Selenium Design Patterns and Best Practices
- Java程序員面試算法寶典
- C語(yǔ)言從入門(mén)到精通(第4版)
- CouchDB and PHP Web Development Beginner’s Guide
- Spring Boot+Vue全棧開(kāi)發(fā)實(shí)戰(zhàn)
- Nagios Core Administration Cookbook(Second Edition)
- Mastering Concurrency Programming with Java 9(Second Edition)
- 基于GPU加速的計(jì)算機(jī)視覺(jué)編程:使用OpenCV和CUDA實(shí)時(shí)處理復(fù)雜圖像數(shù)據(jù)
- 寫(xiě)給青少年的人工智能(Python版·微課視頻版)
- Flink入門(mén)與實(shí)戰(zhàn)