Download the PHP package hrevert/ht-oauth-server-client-module without Composer
On this page you can find all versions of the php package hrevert/ht-oauth-server-client-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hrevert/ht-oauth-server-client-module
More information about hrevert/ht-oauth-server-client-module
Files in hrevert/ht-oauth-server-client-module
Package ht-oauth-server-client-module
Short Description A Zend Framework 2 module which provides custom grant for zfr-oauth2-server to authenticate users via third party applications like facebook, google etc
License MIT
Informations about the package ht-oauth-server-client-module
HtOauth\Server\ClientModule
A Zend Framework 2 module which provides custom grant for zfr-oauth2-server to authenticate users via third party applications like facebook, google etc.
What's with the name?
The module provides a grant for a oauth2 server and it is also a client for oauth2 servers of facebook, google etc. So, it is named as server as well as client.
Installation
- Add
"hrevert/ht-oauth-server-client-module": "0.3.*"
to composer.json and runphp composer.phar update
. - Enabled the following modules in
config/application.config.php
.
Configuring the module
Setting the User class
User class must implement Hrevert\OauthClient\Model\UserInterface
. Then, you need to modify the Doctrine mapping to associate this interface with your own user class.
Provider configuration
You need to define the credentials like client id, client secret and other configuration. Read this for these configuration.
Adding grant types
Enabling providers
Enable providers by adding records to the table oauth_provider
.
Autocreating user
When a new user tries to log in, s/he is not allowed to log in by default.
To automatically create a new user, you need to specify a callable for creating a user.
How It Works
Login with OAuth 2.0
- Client: Client sends a
POST
request to the server at /oauth/token with oauth2 authorization code or access token. - Server: With authorization code, authorization code is exchanged for provider access token.
- Server: User information is retrived using the provider access token from Step 2.
- Server: Look up the user by the unique provider id. If user already exists, grab the existing user, otherwise create a new user account.
- Server: Reply with a new access token.
All versions of ht-oauth-server-client-module with dependencies
hrevert/ht-oauth-client-module Version 0.0.*
hrevert/ht-league-oauth-client-module Version 0.3.*
zendframework/zend-stdlib Version ~2.2
zfr/zfr-oauth2-server-module Version 0.7.*