search
Homephp教程php手册利用php搭建oauth

利用php搭建oauth

Jun 06, 2016 pm 07:59 PM
oauthphpusebuildstandard

oauth是一种标准,主要是用来对用户资源的使用进行授权的,相关的简介可以很容易的从互联网上找到。 本来是想利用oauth.net上的oauth库搭建一个php的oauth,一直没有调试通,可以自动生成key和secret,但是到了发放requirest token时就出错误了,最后看到php

oauth是一种标准,主要是用来对用户资源的使用进行授权的,相关的简介可以很容易的从互联网上找到。


本来是想利用oauth.net上的oauth库搭建一个php的oauth,一直没有调试通,可以自动生成key和secret,但是到了发放requirest token时就出错误了,最后看到php也有自带的oauth模块,就转用php模块,php的扩展模块都放在php/ext目录下的,在网上下载了一个php_oauth.dll文件,放在目录下,在php.ini中加入extension=php_oauth.dll,重新启动apache,在phpinfo中看看这个模块有没有正常加载,phpinfo()中出现下列内容就表明成功了。


利用php搭建oauth



http://115.com/file/bem43tk7#php-oauth.dll  下载地址


同学给了一个例子,这个实例就是利用php oauth模块实现认证功能,其中省去了获取appkey 和secret的步骤,将example放在根目录下,新建一个数据库,导入sql文件夹里的sql文件,修改class文件夹里的Db.class.php文件里的数据库配置,在浏览器中浏览client下的index.php文件,要用到的测试用户名为test,大概流程是,在这个index页面获得Request token和Request token secret。


http://115.com/file/e7jhw9yp#OAuthProviderExample.zip 实例下载地址



(ps:我的环境是winxp+xampp1.7.7,最开始用的是appserv套件,没有配置成功,换了xampp后就可以了)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.