Skip to content

A library for communicating to plumdistrict for user authentication and limited information retrieval.

Notifications You must be signed in to change notification settings

plumdistrict/plumdistrict-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plumdistrict OAuth

This library can be used by client applications to authenticate users against www.plumdistrict.com and retrieve limited user information.

A client application must have been registered at plumdistrict and a unique client_id and client_secret must have been issued for the client application to make requests.

The application server IP address must also have been white-listed to be able to access information.

Examples:

# Get a user token

PlumDistrict::OAuth.@client_id = 'plumdistrictapitoken'
PlumDistrict::OAuth.@client_secret = 'plumdistrictapitokensecret'
result_hash = PlumDistrict::OAuth.authorize_user('test@example.com', 'somepassword')

# Get user information

users_oauth_token =  result_hash['access_token']
user_info_hash =  PlumDistrict::OAuth.users_info(users_oauth_token)

email      =  user_info_hash['email']
first_name =  user_info_hash['first_name']
last_name  =  user_info_hash['last_name']

# Revoke user token privilege

PlumDistrict::OAuth.revoke_user(users_oauth_token)

Released under the MIT License: www.opensource.org/licenses/mit-license.php

About

A library for communicating to plumdistrict for user authentication and limited information retrieval.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages