Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
version bump, updated documentation, example config files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisweb committed May 10, 2016
1 parent 0615133 commit 38cfa93
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 79 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/examples/GooglePlusOAuth2/nbproject/
/examples/FacebookOpenGraphOAuth2/application/configs/facebook_api.ini
/examples/JamendoApiOAuth2/application/configs/jamendo_api.ini
/examples/GooglePlusOAuth2/application/configs/google_plus_api.ini
/examples/GooglePlusOAuth2/application/configs/google_plus_api.ini
/nbproject/private/
174 changes: 96 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,17 @@ About:

Zend Framework 1 OAuth 2 Library

version 1.1.0
version 1.1.1

Examples:
=========

Zend Framework 1 OAuth 2 examples.

Jamendo API OAuth 2
-------------------

1) Add the latest Zend Framework and the Chrisweb library to the library directory.

2) Setup an Apache vhost for the example:

apache vhost.conf

```
<VirtualHost *:80>
ServerName www.jamendoapioauth2.dev
DocumentRoot /path/to/examples/JamendoApiOAuth2/public
ErrorLog "logs/jamendoapioauth2-error.log"
CustomLog "logs/jamendoapioauth2-access.log" combined
SetEnv APPLICATION_ENV "development"
<Directory /path/to/examples/JamendoApiOAuth2/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
```

3) Update your hosts file:

127.0.0.1 www.jamendoapioauth2.dev

4) Create a Jamendi API account, then create a configuration file and add the values:

```
; application/configs/jamendo_api.ini
; http://developer.jamendo.com/v3.0/oauth2
; to get a jamendo api account visit: https://devportal.jamendo.com/
; jamendo api configuration
dialogEndpoint = https://api.jamendo.com/v3.0
oauthEndpoint = https://api.jamendo.com/v3.0
clientId = 0000000000
clientSecret = 0000000000000000000000000000
callbackUrl = http://www.jamendoapioauth2.dev/jamendocallback
oauthDialogUri = /oauth/authorize
accessTokenUri = /oauth/grant
stateSecret = afs4f4g8e4asgaas
grantType = authorization_code
requestedRights = music ; = scope
responseType = code ; = response_type
```

Facebook Open Graph API OAuth 2
-------------------------------

1) Add the latest Zend Framework and the Chrisweb library to the library directory.
1) Add the latest "Zend" Framework linrary and the "Chrisweb" library to the library directory

2) Setup an Apache vhost for the example:

Expand All @@ -93,29 +38,37 @@ apache vhost.conf
</VirtualHost>
```

3) Update your hosts file:
3) (optional) Update your hosts file:

127.0.0.1 www.facebookopengraphoauth2.dev

4) Create a Facebook API account, then create a configuration file and add the values:
3.1) or just use the localhost IP to access the example(s)

```
; application/configs/facebook_api.ini
http://127.0.0.1

4) Create a Facebook API account at https://developers.facebook.com/apps

Don't forget to set the go to "Settings" and set the correct "App Domains" (for example www.facebookopengraphoauth2.test) and also set the "Website / Site Url" (for example www.facebookopengraphoauth2.test)

; https://developers.facebook.com/docs/howtos/login/server-side-login/
5) Finally go into "/examples/FacebookOpenGraphOAuth2/application/configs/" and rename the file "facebook_api_EXAMPLE.ini" to "facebook_api.ini" and add your own values where needed

5.1) Or if you prefer you can also create a new configuration file named "facebook_api.ini" in "/examples/FacebookOpenGraphOAuth2/application/configs/" and add the following values:

```
; documentation: https://developers.facebook.com/docs/facebook-login
; facebook api configuration
; facebook OAuth api configuration
dialogEndpoint = https://www.facebook.com
oauthEndpoint = https://graph.facebook.com
clientId = 000000000000000000
clientSecret = 000000000000000000000000000000
clientId = 000000000000000000 ; change this with own values: clientId => Facebook App ID
clientSecret = 000000000000000000000000000000 ; change this with own values: clientSecret => Facebook App Secret
callbackUrl = http://www.facebookopengraphoauth2.dev/facebookcallback
responseType = code ; or token, none, signed_request
oauthDialogUri = /dialog/oauth
accessTokenUri = /oauth/access_token
stateSecret = afs4f4g8e4asgaas
; permissions https://developers.facebook.com/docs/concepts/login/permissions-login-dialog/
requestedRights = email,user_actions.music,user_likes
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
; permissions https://developers.facebook.com/docs/facebook-login/permissions
requestedRights = email
```

Google+ API OAuth 2
Expand Down Expand Up @@ -146,29 +99,94 @@ apache vhost.conf
</VirtualHost>
```

3) Update your hosts file:
3) (optional) Update your hosts file:

127.0.0.1 www.googleplusoauth2.dev

4) Create a Google+ API account, then create a configuration file and add the values:
3.1) or just use the localhost IP to access the example(s)

```
; application/configs/google_plus_api.ini
http://127.0.0.1

4) Create a Google+ API account at https://console.developers.google.com

; https://developers.google.com/+/api/oauth
5) Finally go into "/examples/GooglePlusOAuth2/application/configs/" and rename the file "google_plus_api_EXAMPLE.ini" to "google_plus_api.ini" and add your own values where needed

5.1) Or if you prefer you can also create a new configuration file named "google_plus_api.ini" in "/examples/GooglePlusOAuth2/application/configs/" and add the following values:

```
; documentation: https://developers.google.com/+/web/api/rest/oauth
; google+ api configuration
dialogEndpoint = https://accounts.google.com/o/oauth2
oauthEndpoint = https://accounts.google.com/o/oauth2
clientId = 0000000000000000.apps.googleusercontent.com
clientSecret = 00000000000000000000000000000
responseType = code ; https://developers.google.com/accounts/docs/OAuth2Login#responsetypeparameter
clientId = 0000000000000000.apps.googleusercontent.com ; change this with own values
clientSecret = 00000000000000000000000000000 ; change this with own values
responseType = code ; https://developers.google.com/identity/protocols/OpenIDConnect#responsetypeparameter
callbackUrl = http://127.0.0.1/googlepluscallback
secretType =
immediate =
oauthDialogUri = /auth
accessTokenUri = /token
stateSecret = afs4f4g8e4asgaas
; google+ scopes https://developers.google.com/+/api/oauth#scopes
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
; google+ scopes https://developers.google.com/+/web/api/rest/oauth#authorization-scopes
requestedRights = https://www.googleapis.com/auth/plus.login,https://www.googleapis.com/auth/plus.me,https://www.googleapis.com/auth/userinfo.email
```

Jamendo API OAuth 2
-------------------

1) Add the latest Zend Framework and the Chrisweb library to the library directory.

2) Setup an Apache vhost for the example:

apache vhost.conf

```
<VirtualHost *:80>
ServerName www.jamendoapioauth2.dev
DocumentRoot /path/to/examples/JamendoApiOAuth2/public
ErrorLog "logs/jamendoapioauth2-error.log"
CustomLog "logs/jamendoapioauth2-access.log" combined
SetEnv APPLICATION_ENV "development"
<Directory /path/to/examples/JamendoApiOAuth2/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
```

3) (optional) Update your hosts file:

127.0.0.1 www.jamendoapioauth2.dev

3.1) or just use the localhost IP to access the example(s)

http://127.0.0.1

4) Create a Jamendi API account at https://developer.jamendo.com/v3.0

5) Finally go into "/examples/JamendoApiOAuth2/application/configs/" and rename the file "jamendo_api_EXAMPLE.ini" to "jamendo_api.ini" and add your own values where needed

5.1) Or if you prefer you can also create a new configuration file named "jamendo_api.ini" in "/examples/JamendoApiOAuth2/application/configs/" and add the following values:

```
; documentation: https://developer.jamendo.com/v3.0/authentication#oauth2-authorize-request
; jamendo api configuration
dialogEndpoint = https://api.jamendo.com/v3.0
oauthEndpoint = https://api.jamendo.com/v3.0
clientId = 0000000000 ; change this with own values
clientSecret = 0000000000000000000000000000 ; change this with own values
callbackUrl = http://www.jamendoapioauth2.dev/jamendocallback
oauthDialogUri = /oauth/authorize
accessTokenUri = /oauth/grant
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
grantType = authorization_code
requestedRights = music ; = scope
responseType = code ; = response_type
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; documentation: https://developers.facebook.com/docs/facebook-login

; facebook OAuth api configuration
dialogEndpoint = https://www.facebook.com
oauthEndpoint = https://graph.facebook.com
clientId = 000000000000000000 ; change this with own values: clientId => Facebook App ID
clientSecret = 000000000000000000000000000000 ; change this with own values: clientSecret => Facebook App Secret
callbackUrl = http://www.facebookopengraphoauth2.dev/facebookcallback
responseType = code ; or token, none, signed_request
oauthDialogUri = /dialog/oauth
accessTokenUri = /oauth/access_token
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
; permissions https://developers.facebook.com/docs/facebook-login/permissions
requestedRights = email
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; documentation: https://developers.google.com/+/web/api/rest/oauth

; google+ api configuration
dialogEndpoint = https://accounts.google.com/o/oauth2
oauthEndpoint = https://accounts.google.com/o/oauth2
clientId = 0000000000000000.apps.googleusercontent.com ; change this with own values
clientSecret = 00000000000000000000000000000 ; change this with own values
responseType = code ; https://developers.google.com/identity/protocols/OpenIDConnect#responsetypeparameter
callbackUrl = http://127.0.0.1/googlepluscallback
secretType =
immediate =
oauthDialogUri = /auth
accessTokenUri = /token
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
; google+ scopes https://developers.google.com/+/web/api/rest/oauth#authorization-scopes
requestedRights = https://www.googleapis.com/auth/plus.login,https://www.googleapis.com/auth/plus.me,https://www.googleapis.com/auth/userinfo.email
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; documentation: https://developer.jamendo.com/v3.0/authentication#oauth2-authorize-request

; jamendo api configuration
dialogEndpoint = https://api.jamendo.com/v3.0
oauthEndpoint = https://api.jamendo.com/v3.0
clientId = 0000000000 ; change this with own values
clientSecret = 0000000000000000000000000000 ; change this with own values
callbackUrl = http://www.jamendoapioauth2.dev/jamendocallback
oauthDialogUri = /oauth/authorize
accessTokenUri = /oauth/grant
stateSecret = SOME_SECRET ; change this with own values, change the secret every time you think it could have been compromised, it is used to ensure the OAuth requests really come from your app
grantType = authorization_code
requestedRights = music ; = scope
responseType = code ; = response_type
7 changes: 7 additions & 0 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_56
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>zend-framework-1-oauth-2-library</name>
</data>
</configuration>
</project>

0 comments on commit 38cfa93

Please sign in to comment.