Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlesbihis/actionscript-oauth2
An ActionScript 3 library for interfacing with OAuth 2.0 services.
https://github.com/charlesbihis/actionscript-oauth2
Last synced: about 2 months ago
JSON representation
An ActionScript 3 library for interfacing with OAuth 2.0 services.
- Host: GitHub
- URL: https://github.com/charlesbihis/actionscript-oauth2
- Owner: charlesbihis
- License: other
- Created: 2011-12-15T01:40:35.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2022-03-17T08:06:45.000Z (almost 3 years ago)
- Last Synced: 2024-08-03T05:02:28.492Z (5 months ago)
- Language: ActionScript
- Homepage: http://charlesbihis.github.io/actionscript-oauth2/
- Size: 514 KB
- Stars: 110
- Watchers: 18
- Forks: 28
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actionscript-sorted - actionscript-oauth2 - An ActionScript 3 library for interfacing with OAuth 2.0 services. (Networking / Authentication)
README
# ActionScript OAuth 2.0 Library
An ActionScript 3 library for interfacing with OAuth 2.0 services, implemented according to the [OAuth 2.0 v2.15 specification](http://tools.ietf.org/html/draft-ietf-oauth-v2-15).
## Overview
This library is built for use with Flash/Flex/AIR projects to facilitate communication with OAuth 2.0 services. It provides mechanisms to authenticate against OAuth 2.0 servers using all standard authentication and authorization workflows.
This project was first mentioned in my blog post at http://blogs.adobe.com/charles/2012/05/oauth-2-0-library-for-actionscript.html.
### Features
The ActionScript OAuth 2.0 Library supports the following features...
* Ability to [fetch an access token](http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4) via the OAuth 2.0 supported workflows...
* [Authorization Code Grant workflow](http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.1)
* [Implicit Grant workflow](http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.2)
* [Resource Owner Password Credentials workflow](http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.3)
* Ability to [refresh an access token](http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-6)
* Robust and adjustable logging
* Ability to log in, view, and interact with the user consent page within a given StageWebView object### Dependencies
* [as3corelib](https://github.com/mikechambers/as3corelib)
* [as3commons-logging](http://code.google.com/p/as3-commons/)## Reference
### Usage
To use the library, simply drop in the SWC (or the source) into your project, along with the appropriate dependencies, and follow the usage below...
// set up our StageWebView object to use our visible stage
stageWebView.stage = stage;
// set up the call
var oauth2:OAuth2 = new OAuth2("https://accounts.google.com/o/oauth2/auth", "https://accounts.google.com/o/oauth2/token", LogSetupLevel.ALL);
var grant:IGrantType = new AuthorizationCodeGrant(stageWebView, // the StageWebView object for which to display the user consent screen
"INSERT_CLIENT_ID_HERE", // your client ID
"INSERT_CLIENT_SECRET_HERE", // your client secret
"INSERT_REDIRECT_URI_HERE", // your redirect URI
"INSERT_SCOPE_HERE", // (optional) your scope
"INSERT_STATE_HERE"); // (optional) your state
// make the call
oauth2.addEventListener(GetAccessTokenEvent.TYPE, onGetAccessToken);
oauth2.getAccessToken(grant);
function onGetAccessToken(getAccessTokenEvent:GetAccessTokenEvent):void
{
if (getAccessTokenEvent.errorCode == null && getAccessTokenEvent.errorMessage == null)
{
// success!
trace("Your access token value is: " + getAccessTokenEvent.accessToken);
}
else
{
// fail :(
}
} // onGetAccessToken### Demo
* Demo description: http://blogs.adobe.com/charles/2012/05/oauth-2-0-library-for-actionscript.html
* Demo source: https://github.com/charlesbihis/sandbox/tree/master/actionscript/actionscript-oauth2-mobile-demo### Documentation
You can find the full ASDocs for the project [here](http://charlesbihis.github.com/actionscript-oauth2/docs/).
## Author
* Created by Charles Bihis
* Website: [www.whoischarles.com](http://www.whoischarles.com)
* E-mail: [[email protected]](mailto:[email protected])
* Twitter: [@charlesbihis](http://www.twitter.com/charlesbihis)## License
The ActionScript OAuth 2.0 Library is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).