Java application programming based on OAuth security protocol

Source: Internet
Author: User
Tags oauth

The OAuth protocol is dedicated to making Web sites and applications (collectively, consumer Consumer) able to access the protected resources of the user to the provider (service Provider) through the API without the user disclosing their authentication information. More generally, OAuth provides a freely implemented and universal method for API authentication. At present, many Internet services, such as Open API, have provided OAuth authentication Service, and OAuth Standard has gradually become the standard of open resource authorization. This article discusses how to use the OAuth Java library provided on Google Code to implement a OAuth-based Java application and, with Google's data Service, gives examples of accessing Google data using the OAuth approach.

OAuth Introduction

OAuth was co-sponsored by Blaine Cook, Chris Messina, Larry Halff and David Recordon to provide a safe and open standard for API access authorization.

Based on OAuth authentication authorization has the following characteristics:

Safety. OAuth differs from other licensing methods: OAuth authorization does not allow consumers (Consumer) to touch the user's account information (such as user name and password), but also means that consumers can apply for the authorization of the user's resources without using the user's username and password.

Open. Any consumer can use the OAuth Authentication Service, any service provider (Provider) can achieve its own OAuth certification services.

Simple. Both consumers and service providers are easy to understand and use.

The OAuth solution is shown in the following illustration.

Figure 1. OAuth Solution

As shown in Figure 1, the triangular relationship between users, consumers, and their service providers in the OAuth solution: When a user needs Consumer to provide a service for it, the service involves acquiring the user's protection resources from the service provider. OAuth Guarantee: Only if the user is explicitly authorized (step 4), the consumer can get the user's resources and use it to serve the user.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.