current location: Home > download site > Library download > Other libraries > OAuth PHP library
OAuth PHP library
Classify: Library download / Other libraries | Release time: 2017-12-12 | visits: 1657 |
Download: 71 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 How to Populate an HTML Dropdown List with Data from a MySQL Database?
- 2 dvwssr.dll - What is dvwssr.dll?
- 3 How to Concatenate C Strings on a Single Line?
- 4 How Can We Handle Idle MySQL Connections?
- 5 How to Handle Authentication Cookies for HTTP Requests in Go?
- 6 What is cloud mining?
- 7 How to Troubleshoot "Can't Connect to MySQL Server" Errors When Connecting Remotely via Command Line? .
- 8 Why Can't I Update a Table Inside a Trigger That's Modifying the Same Table in MySQL?
- 9 How to Extract Multi-Line Text from HTML with JavaScript Regex?
- 10 Python Functions and Modules: Writing Reusable Code Like a Pro
- 11 Block Mayhem codes for November 2024
- 12 How Can C Programmers Develop Powerful Browser Plugins with NPAPI?
- 13 How can I run my Go application with administrator privileges without manual UAC elevation?
- 14 Can I Use XPath with BeautifulSoup?
- 15 How to Convert Integers to Strings in PHP: Which Method Is Best?
Latest Tutorials
-
- Go language practical GraphQL
- 1993 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3410 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1797 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2611 2024-03-29
The OAUTH protocol provides a secure, open and simple standard for the authorization of user resources. At the same time, any third party can use the OAUTH authentication service, and any service provider can implement its own OAUTH authentication service, so OAUTH is open. The industry provides multiple implementations of OAUTH, such as PHP, JavaScript, Java, Ruby and other language development kits, which greatly saves programmers' time, so OAUTH is simple. Many Internet services such as Open API, and many large companies such as Google, Yahoo, Microsoft, etc. provide OAUTH authentication services. These are enough to show that the OAUTH standard has gradually become the standard for open resource authorization.
class ServiceFactory { protected $httpClient; protected $serviceClassMap = array( 'OAuth1' => array(), 'OAuth2' => array() ); protected $serviceBuilders = array( 'OAuth2' => 'buildV2Service', 'OAuth1' => 'buildV1Service', ); public function setHttpClient(ClientInterface $httpClient) { $this->httpClient = $httpClient; return $this; } public function registerService($serviceName, $className) { if (!class_exists($className)) { throw new Exception(sprintf('Service class %s does not exist.', $className)); } $reflClass = new \ReflectionClass($className); foreach (array('OAuth2', 'OAuth1') as $version) { if ($reflClass->implementsInterface('OAuth\' . $version . '\Service\ServiceInterface')) { $this->serviceClassMap[$version][ucfirst($serviceName)] = $className; return $this; } } throw new Exception(sprintf('Service class %s must implement ServiceInterface.', $className)); }