2017 © Pedro Peláez
 

library gateway-module

Zend Framework 2 module that extends zoop's Shard Module with authentication services

image

zoopcommerce/gateway-module

Zend Framework 2 module that extends zoop's Shard Module with authentication services

  • Wednesday, September 10, 2014
  • by superdweebie
  • Repository
  • 2 Watchers
  • 1 Stars
  • 377 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Zoop gateway-module

Build Status, (*1)

Zend Framework 2 module that extends zoop's Shard Module with authentication services. Provides:, (*2)

  • Stateful authentication once per session (for stateful services, such as a website with login form)
  • Secure remember me cookies for long lasting authentication across sessions
  • Stateless authentication once per request (for stateless services, such as a REST api)

Install

Add the following to your composer root:, (*3)

"require": {
    "zoopcommerce/gateway-module" : "~1.0"
}

Add the module to your application config:, (*4)

'modules' => [
    'Zoop\GatewayModule'
],

Configuration

See config/module.config.php for config options., (*5)

Per Session Use

Requires per-session to be enabled in the module config., (*6)

To login, send the following request:, (*7)

http://mysite.com/rest/authenticated-user
POST
Content: '{"username": <username>, "password": <password>}'
Accept: application/json
Content-type: application/json

On successful login, request will return the authenticated user object as json. On login fail, will return an error as json., (*8)

To logout, send the following request:, (*9)

http://mysite.com/rest/authenticated-user
DELETE

To get the currently authenticated user, send the following request:, (*10)

http://mysite.com/rest/authenticated-user
GET
Accept: application/json

Remember Me Use

Requires per-session and remember me to be enabled in the module config., (*11)

If to use the remember me service on login, send the following request:, (*12)

http://mysite.com/rest/authenticated-user
POST
Content: '{"username": <username>, "password": <password>, "rememberMe": true}'
Accept: application/json
Content-type: application/json

Per Request Use

Requires per request to be enabled in the module config., (*13)

To authenticate on any request, add the following http header:, (*14)

http Authorization: Basic <username:password>

must be base64 encoded, and the request must be made across https, not http., (*15)

The Versions