GithubHelp home page GithubHelp logo

weaverx9x9 / titanium-oauth2-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from organisedminds/titanium-oauth2-client

0.0 2.0 0.0 83 KB

Oauth 2.0 Client Module for Titanium Appcelerator Applications

License: MIT License

titanium-oauth2-client's Introduction

titanium-oauth2-client

Oauth 2.0 Client Module for Titanium Appcelerator Applications

titanium-oauth2-client makes it really easy to integrate oauth 2.0 client into your Titanium Appcelerator application. It was tested with Doorkeeper - awesome oauth provider for your Rails app, but it is still in development state (so expect some things to be broken). Every help by contributors is cheerfully welcome!

titanium-oauth-2-client is sponsored and used by OrganisedMinds - A super useful flexible tool for collaborating in teams and projects across geographic locations. Why don't you sign up there? It's free!

OragnisedMinds logo

What is Oauth 2.0?

You can start here: http://oauth.net/2/

and get complete specification here: http://tools.ietf.org/html/draft-ietf-oauth-v2-28

This project is suited for Doorkeeper OAuth 2.0 provider for Ruby on Rails.

How to use it?

Getting module

git clone git://github.com/OrganisedMinds/titanium-oauth2-client.git /your-project/Resources/lib/oauth_adapter

Make a request to you API

Ti.include('lib/auth_module.js');

/* Init Auth Module */
Ti.App.authModule = AuthModule.init({
  client_id:       "your_client_id",
  client_secret:   "your_client_secret",
  redirect_uri:    "http://your_redirect_uri:3000/",
  auth_server_url: "http://your_auth_server_url:3000/"
});

/* Create a request to your resource server */
var updateMyName = new Request({
	method: 'PUT',
	url:    'http://your_resource_server_url/personal/details',
	ext:    {
	  first_name: "Vito",
	  last_name:  "Corleone"
	}
});

/* Set your own onload and onerror methods */
updateMyName.xhr.onload = function(e) {
  // do something
  /* Set request as done */
  updateMyName.setAsDone();
}
updateMyName.xhr.error = function(e) {
  // do something
  /* Set request as done */
  updateMyName.setAsDone();
}

/* Send the request (this will start max. 3 clients and it will queue all other request till user is authorized */
RequestCountLimiter.add(updateMyName);
RequestCountLimiter.checkState();

Contributing to titanium-oauth2-client

  • Be sure you have Doorkeeper running and you registered your app
  • Check out the latest develop to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
  • Fork the project
  • Start feature/bugfix branch
  • Commit and push until you are happy with your contribution.
  • Make a new pull request to OrganisedMinds develop branch

Additional information

License

Copyright © 2012 Jiří Chára. See LICENSE.txt for further details.

titanium-oauth2-client's People

Contributors

jirichara avatar

Watchers

James Cloos avatar weaver hastings avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.