# Using OAuth 2.0 for Web Server Applications This document explains how web server applications use the Google API Client Library for Python to implement OAuth 2.0 authorization to access Google APIs. OAuth 2.0 allows users to share specific data with an application while keeping their usernames, passwords, and other information private. For example, an application can use OAuth 2.0 to obtain permission from users to store files in their Google Drives. This OAuth 2.0 flow is specifically for user authorization. It is designed for applications that can store confidential information and maintain state. A properly authorized web server application can access an API while the user interacts with the application or after the user has left the application. Web server applications frequently also use [service accounts](service-accounts.md) to authorize API requests, particularly when calling Cloud APIs to access project-based data rather than user-specific data. Web server applications can use service accounts in conjunction with user authorization. ## Prerequisites ### Enable APIs for your project Any application that calls Google APIs needs to enable those APIs in the API Console. To enable the appropriate APIs for your project: 1. Open the [Library](https://console.developers.google.com/apis/library) page in the API Console. 1. Select the project associated with your application. Create a project if you do not have one already. 1. Use the **Library** page to find each API that your application will use. Click on each API and enable it for your project. ### Create authorization credentials Any application that uses OAuth 2.0 to access Google APIs must have authorization credentials that identify the application to Google's OAuth 2.0 server. The following steps explain how to create credentials for your project. Your applications can then use the credentials to access APIs that you have enabled for that project.
Web
application
. Applications that use languages and frameworks
like PHP, Java, Python, Ruby, and .NET must specify authorized
redirect URIs. The redirect URIs are the endpoints to which the
OAuth 2.0 server can send responses.http://localhost:8080
. With that in mind, please
note that all of the examples in this document use
http://localhost:8080
as the redirect URI.