Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth 2.0 Demo

Symfony Project Demo integrate FOSOAuthServerBundle & FosUserBundle ###Install 1. Clone Projects 2. Install composer

composer install

3. Update schema

php app/console doctrine:schema:update --force

###Usage 1. Add more test user

php app/console fos:user:create admin [email protected] adminpass
php app/console fos:user:create test [email protected] testpass

2. Run command create new client

php app/console app:oauth-server:client:create --redirect-uri="http://client.dev/app_dev.php/demo/login_oauth" --grant-type="authorization_code" --grant-type="..."

will receive:

- Added a new client with public id 7_50dtjqmb038c8k8wocgckss8so8kkok0gg04g4cswcswo4ockk, secret 3nvp505hg42s8ok840ksgg80kcw4o88k40gkgosog4sosckgko

So client_id = 7_50dtjqmb038c8k8wocgckss8so8kkok0gg04g4cswcswo4ockk & secret_id = 3nvp505hg42s8ok840ksgg80kcw4o88k40gkgosog4sosckgko

3. Link authorized

http://oauth2server/app_dev.php/oauth/v2/auth?client_id=7_50dtjqmb038c8k8wocgckss8so8kkok0gg04g4cswcswo4ockk&response_type=code&redirect_uri=http://client.dev/app_dev.php/demo/login_oauth&scope=me

Scope demo: me, categories

4. API demo

See ApiController.php

/api/users
/api/user
/api/categories
/api/categories/{id}

About

Demo integrate FOSOAuthServerBundle & FosUserBundle

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages