{"id":13743664,"url":"https://github.com/oauth-io/oauth-flex","last_synced_at":"2026-01-04T04:56:20.586Z","repository":{"id":11208340,"uuid":"13594016","full_name":"oauth-io/oauth-flex","owner":"oauth-io","description":"OAuth.io plugin for Apache Flex/ActionScript","archived":false,"fork":false,"pushed_at":"2013-11-26T17:31:49.000Z","size":120,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-15T14:35:43.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oauth-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-15T15:30:49.000Z","updated_at":"2015-05-23T19:26:46.000Z","dependencies_parsed_at":"2022-09-10T06:01:57.027Z","dependency_job_id":null,"html_url":"https://github.com/oauth-io/oauth-flex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-io%2Foauth-flex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-io%2Foauth-flex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-io%2Foauth-flex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-io%2Foauth-flex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oauth-io","download_url":"https://codeload.github.com/oauth-io/oauth-flex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174320,"owners_count":21865848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:00:54.674Z","updated_at":"2026-01-04T04:56:20.546Z","avatar_url":"https://github.com/oauth-io.png","language":"ActionScript","funding_links":[],"categories":["Networking"],"sub_categories":["Authentication"],"readme":"# OAuth.io ActionScript / Apache Flex Plugin\r\n\r\nThis is the official plugin for [OAuth.io](https://oauth.io) in [Apache Flex](http://flex.apache.org/) (formerly Adobe Flex)!\r\n\r\nThe OAuth.io plugin for Apache Flex allows you to use almost the same JavaScript code in your Flex application as you use in your web application, to connect any OAuth provider [available on OAuth.io](https://oauth.io/providers).\r\n\r\nLot of providers does not implement the _token_ response type, which typically lead developers to expose their secret keys. Using our unified interface, you always receive a token with a unique public key, and whatever the provider's implementation.\r\n\r\n\r\n## OAuth.io Requirements and Set-Up\r\n\r\nTo use this plugin you will need to make sure you've registered your OAuth.io app and have a public key (https://oauth.io/docs).\r\n\r\n\r\n### Installation\r\n\r\nYou can install this plugin into your project by downloading the latest zip from github or clone this repository.\r\n\r\nThen, you can reference this library in your project or add it in your library path.\r\n\r\n### Usage\r\n\r\nIn your code, add this line to initialize an OAuth object:\r\n\r\n\tvar oauth:OAuth = new OAuth(\"Public key\");\r\n\r\nTo connect your user to a provider (e.g. facebook):\r\n\r\n ```javascript\r\noauth.addEventListener(OAuthEvent.ERROR, function(event:OAuthEvent):void {\r\n\ttrace(event.error + \" error:\" + event.errorMessage);\r\n});\r\noauth.addEventListener(OAuthEvent.TOKEN, function(event:OAuthEvent):void {\r\n\ttrace(\"token \" + event.accessToken + \", expires \" + event.expires);\r\n});\r\noauth.popup(\"facebook\");\r\n ```\r\n \r\n If you listen for more than one provider, you may want to check `event.provider` that contains the provider's name. Moreover, `OAuth.popup` returns a `OAuthPopup` object which also dispatch the `OAuthEvent` specifically for this authorization:\r\n \r\n ```javascript\r\nvar fb_popup:OAuthPopup = oauth.popup(\"facebook\");\r\nfb_popup.addEventListener(OAuthEvent.ERROR, function(event:OAuthEvent):void {\r\n\ttrace(event.error + \" error:\" + event.errorMessage);\r\n});\r\nfb_popup.addEventListener(OAuthEvent.TOKEN, function(event:OAuthEvent):void {\r\n\ttrace(\"token \" + event.accessToken + \", expires \" + event.expires);\r\n});\r\n ```\r\n\r\n\r\n#### API Calls\r\n\r\nYou can also directly call APIs with the `OAuthHTTPService` class that wraps the default `HTTPService`. As the original one, you have two way to do these calls: either passing by mxml, or using only actionscript.\r\n\r\nThis class also add JSON encoding and decoding to the original `HTTPService` so you can set resultFormat to \"json\" and contentType to \"application/json\" if needed. \r\n\r\n - Using MXML:\r\n\r\nIn `fx:Declarations` bloc, create your `OAuthHTTPService`:\r\n ```xml\r\n\u003coauth:OAuthHTTPService\r\n    id=\"fb_me\" from=\"{fb_auth}\" url=\"/me\" resultFormat=\"json\"\r\n    result=\"resultHandler(event)\"\r\n    fault=\"faultHandler(event)\" /\u003e\r\n ```\r\n \r\n To send the request:\r\n ```javascript\r\n[Bindable] private var fb_auth:OAuthEvent = null;\r\noauth.addEventListener(OAuthEvent.TOKEN, function(event:OAuthEvent):void {\r\n    fb_auth = event;\r\n    fb_me.send();\r\n});\r\noauth.popup(\"facebook\", {authorize:{display:\"touch\"}});\r\n ```\r\n\r\n To handle the response:\r\n ```javascript\r\nprivate function resultHandler(event:ResultEvent):void\r\n{\r\n    trace(\"From facebook, hello \" + event.result.name);\r\n}\r\nprivate function faultHandler(event:FaultEvent):void\r\n{\r\n    trace('api request fail', event);\r\n} \r\n ```\r\n\r\n You can note the `from` property binded to the succeeded `OAuthEvent` which contains the tokens and description of the API calls authorization.\r\n\r\n\r\n - Using ActionScript only:\r\n\r\n ```javascript\r\noauth.addEventListener(OAuthEvent.TOKEN, function(event:OAuthEvent):void {\r\n    var req:OAuthHTTPService = event.http(); // event.http() will create the OAuthHTTPService with from = event\r\n    req.url = '/1.1/account/verify_credentials.json';\r\n    req.resultFormat = 'json';\r\n    req.addEventListener(FaultEvent.FAULT, faultHandler);\r\n    req.addEventListener(ResultEvent.RESULT, function(event:ResultEvent):void {\r\n        trace(\"From twitter, hello \" + event.result.name);\r\n    });\r\n    req.send();\r\n});\r\noauth.popup(\"twitter\");\r\n ```\r\n\r\n### Note\r\n\r\nFor OAuth 1 API requests, the request is proxified via https://oauth.io to sign your request without exposing your secret key. The OAuth 2 API requests are direct since we pass the request's authorizing description beside the tokens.\r\n\r\nThis library will try to access various URLs, so make sure to add\r\n\r\n\t\u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\r\n\r\nin your android permissions ( in `\u003candroid\u003e\u003cmanifestAdditions\u003e` in your app's xml config)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauth-io%2Foauth-flex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foauth-io%2Foauth-flex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauth-io%2Foauth-flex/lists"}