{"id":13515310,"url":"https://github.com/auth0/auth0-cordova","last_synced_at":"2025-10-02T10:31:18.367Z","repository":{"id":19640577,"uuid":"22892776","full_name":"auth0/auth0-cordova","owner":"auth0","description":"Auth0 integration for Cordova apps","archived":true,"fork":false,"pushed_at":"2023-10-27T13:52:34.000Z","size":23417,"stargazers_count":49,"open_issues_count":0,"forks_count":66,"subscribers_count":68,"default_branch":"master","last_synced_at":"2024-09-24T21:04:31.581Z","etag":null,"topics":["cordova-plugin","dx-sdk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auth0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2014-08-12T21:15:10.000Z","updated_at":"2023-12-15T17:40:10.000Z","dependencies_parsed_at":"2023-02-13T22:30:53.154Z","dependency_job_id":"4713c780-2174-4773-9a10-55392686c55c","html_url":"https://github.com/auth0/auth0-cordova","commit_stats":{"total_commits":197,"total_committers":32,"mean_commits":6.15625,"dds":0.6243654822335025,"last_synced_commit":"97c8a21f6ab3e210ef008ede092156fb38df68e1"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-cordova","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-cordova/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-cordova/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-cordova/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/auth0-cordova/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875669,"owners_count":16554698,"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":["cordova-plugin","dx-sdk"],"created_at":"2024-08-01T05:01:09.271Z","updated_at":"2025-10-02T10:31:12.065Z","avatar_url":"https://github.com/auth0.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Auth0 Cordova\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fauth0-cordova.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fauth0-cordova?ref=badge_shield)\n\n\u003e **Warning**\n\u003e This library has been deprecated, and official support will end on October 31, 2023. See the [Migration Guide](./MIGRATION_GUIDE.md) for information to migrate your application to one of our other libraries.\n\nLibrary to make it easy to integrate Auth0 login in your Cordova applications.\n\n## Requirements\n\nThe library requires these two cordova plugins to work:\n\n- cordova-plugin-safariviewcontroller: Shows Safari/Chrome browser ViewController/CustomTab\n- cordova-plugin-customurlscheme: Handles the custom scheme url intents for callback\n\nyou'll need to run\n\n```bash\ncordova plugin add cordova-plugin-safariviewcontroller\ncordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME={application package name} --variable ANDROID_SCHEME={application package name} --variable ANDROID_HOST={auth0 domain} --variable ANDROID_PATHPREFIX=/cordova/{application package name}/callback\n```\n\n\u003e In cordova applications, the application package name is the widget's identifier in `config.xml`\n\nSo if you have the following values\n\n* application package name or widget identifier: com.auth0.cordova.example\n* auth0 domain: samples.auth0.com\n\nin your config you should have some entries like\n\n```xml\n\u003cpreference name=\"AndroidLaunchMode\" value=\"singleTask\" /\u003e\n\u003cplugin name=\"cordova-plugin-customurlscheme\" spec=\"~4.2.0\"\u003e\n    \u003cvariable name=\"URL_SCHEME\" value=\"com.auth0.cordova.example\" /\u003e\n    \u003cvariable name=\"ANDROID_SCHEME\" value=\"com.auth0.cordova.example\" /\u003e\n    \u003cvariable name=\"ANDROID_HOST\" value=\"sample.auth0.com\" /\u003e\n    \u003cvariable name=\"ANDROID_PATHPREFIX\" value=\"/cordova/com.auth0.cordova.example/callback\" /\u003e\n\u003c/plugin\u003e\n\u003cplugin name=\"cordova-plugin-safariviewcontroller\" spec=\"~1.4.6\" /\u003e\n```\n\n## Setup\n\nFrom [npm](https://npmjs.org)\n\n```sh\nnpm install @auth0/cordova\n```\n\nthen in your index.js you need to register the url handler `ondeviceready`\n\n```js\nvar Auth0Cordova = require('@auth0/cordova');\n\nfunction main() {\n    function handlerUrl(url) {\n        Auth0Cordova.onRedirectUri(url);\n    }\n    window.handleOpenURL = handlerUrl;\n    // init your application\n}\n\ndocument.addEventListener('deviceready', main);\n```\n\n## Usage\n\n```js\nconst auth0 = new Auth0Cordova({\n  domain: \"{YOUR_AUTH0_DOMAIN}\",\n  clientId: \"{YOUR_AUTH0_CLIENT_ID}\",\n  packageIdentifier: \"{WIDGET_ID_IN_CONFIG_XML}\"\n});\n\nconst options = {\n  scope: 'openid profile',\n};\n\nauth0.authorize(options, function (err, result) {\n  if (err) {\n    // failure\n  }\n  // success!\n});\n```\n\nThis will open your tenant's hosted login page in the OS browser and will use OAuth 2.0 code grant flow with [Proof Key for Code Exchange](https://tools.ietf.org/html/rfc7636).\n\n## API\n\nFor more information about our API please check our [online documentation](https://auth0.github.io/auth0-cordova/)\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\nFor auth0 related questions/support please use the [Support Center](https://support.auth0.com).\n\n## Common Issues\n\n1. The plugin is not working in Ionic / Cordova dev app. \n\n   The plugin needs to be deployed on a real device to function, this is so because the dev apps do not add the necessary plugins needed for this library to function correctly. You'll need to either create a clone / fork of the Dev App or need to deploy it to a real device to test. \n\n2. The app hangs after authentication \n\n   If 1 does not solve your problem, please make sure you have `cordova-plugin-customurlscheme` installed or an appropirate plugin to handle the callback (like deeplinks / universal links) and you are handling the callback appropriately\n\n\n## Author\n\n[Auth0](auth0.com)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE.txt) file for more info.\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fauth0-cordova.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fauth0-cordova?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fauth0-cordova","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fauth0-cordova","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fauth0-cordova/lists"}