GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - charlesbihis/actionscript-oauth2: An ActionScript 3 library for interfacing with OAuth 2.0 services.

BranchesTags
Open more actions menu

Latest commit

 

History

30 Commits
30 Commits

Folders and files

NameName
Last commit message
Last commit date
libs
libs
 
 
src
src
 
 
.actionScriptProperties
.actionScriptProperties
 
 
.flexLibProperties
.flexLibProperties
 
 
.gitignore
.gitignore
 
 
.project
.project
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

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.

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 via the OAuth 2.0 supported workflows...
    • Authorization Code Grant workflow
    • Implicit Grant workflow
    • Resource Owner Password Credentials workflow
  • Ability to refresh an access token
  • Robust and adjustable logging
  • Ability to log in, view, and interact with the user consent page within a given StageWebView object

Dependencies

  • as3corelib
  • as3commons-logging

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.

Author

  • Created by Charles Bihis
  • Website: www.whoischarles.com
  • E-mail: [email protected]
  • Twitter: @charlesbihis

License

The ActionScript OAuth 2.0 Library is licensed under the Apache License, Version 2.0.

About

An ActionScript 3 library for interfacing with OAuth 2.0 services.

charlesbihis.github.io/actionscript-oauth2/

Resources

Readme
License
Activity

Stars

110 stars

Watchers

17 watching

Forks

28 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.