The 'Koinz' gem is the client-library for koinz services:
- The Koinz omniauth provider (for OAuth2 access)
- For publishing and subscribing to Koinz notifications!
Token Authentication
As a koinz client-application, you can make 2 types of calls to other
applications:
- within the context of the an end-user (Standard OAuth)
- directly invoking a call without the end-user (2-legged)
To invoke an 'token-authenticable' call with user-context
Only For User Manager
[param] auth_token: The auth token string
[param] uri: The uri to be invoked on the User Manager
[returns] Decoded Json information.
Koinz::OAuth2Client::UserManager.call(auth_token, uri)
Example:
Koinz::OAuth2Client::UserManager.call(auth_token, '/users/sign_out.json')
For other applications
[param] auth_token: The auth token string
[param] host: The host you want to invoke this on. MERCHANT_APP, PARTNER_APP etc.
[param] uri: The uri to be invoked on the host
[param] params: optional arguments
[returns] Decoded Json information.
Koinz::OAuth2Client.Application.oauth_call(auth_token, host, uri, params => {})
Example:
Koinz::OAuth2Client.Application.oauth_call(auth_token, MERCHANT_APP, '/merchant.json', :name => 'name'
To invoke a '2-legged' call without user-context
[param] host: The host you want to invoke this on. MERCHANT_APP, PARTNER_APP etc.
[param] uri: The uri to be invoked on the host
[param] params: optional arguments
Koinz::OAuth2Client::Application.two_legged_call(host, uri, params = {})
NOTE: This call is a protected call - internally it picks up the APP, APP_ID and APP_SECRET
of the application and secures a oauth_token. In this particular case, if the application
token has expired, it will be automatically refreshed!