Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
Release 0.4.0 (#112)
Browse files Browse the repository at this point in the history
* Release preparation

* Rebuilt dist files and docs

* Updated changelog (retrofitted 0.3.0 log)
  • Loading branch information
Steve Hobbs committed Oct 16, 2019
1 parent 20a2a83 commit 07140f4
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 46 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## [v0.4.0](https://github.com/auth0/auth0-cordova/tree/v0.4.0) (2019-10-16)
[Full Changelog](https://github.com/auth0/auth0-cordova/compare/v0.3.0...v0.4.0)

**Changed**
- Reformatted telemetry object [\#110](https://github.com/auth0/auth0-cordova/pull/110) ([stevehobbsdev](https://github.com/stevehobbsdev))
- Updated dependencies to fix vulnerabilities [\#111](https://github.com/auth0/auth0-cordova/pull/111) ([stevehobbsdev](https://github.com/stevehobbsdev))

## [v0.3.0](https://github.com/auth0/auth0-cordova/tree/v0.4.0) (2017-12-26)
[Full Changelog](https://github.com/auth0/auth0-cordova/compare/v0.2.0...v0.3.0)

**Changed**
- Deprecate Cordova sample [\#47](https://github.com/auth0/auth0-cordova/pull/47) ([chenkie](https://github.com/chenkie))
- Docs refer to client but it doesn't exist [\#61](https://github.com/auth0/auth0-cordova/pull/47) ([JohnMcLear](https://github.com/JohnMcLear))
- Updated Auth0.js version to 9.0.0 [\#53](https://github.com/auth0/auth0-cordova/pull/53) ([aaguiarz](https://github.com/aaguiarz))
- Update to handle Auth0.js 9 and Update Example to Cordova 8.0 ([faafd9](https://github.com/auth0/auth0-cordova/commit/faafd9644f06853b55df516cbd2915b1a1eeead5)) ([darkyen](https://github.com/darkyen))

## [v0.2.0](https://github.com/auth0/auth0-cordova/tree/v0.2.0) (2017-07-07)
[Full Changelog](https://github.com/auth0/auth0-cordova/compare/v0.1.0...v0.2.0)

Expand Down
14 changes: 2 additions & 12 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/CordovaAuth.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h4 class="name" id="CordovaAuth"><span class="type-signature"></span>new Cordov

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line28">line 28</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line32">line 32</a>
</li></ul></dd>


Expand Down Expand Up @@ -301,7 +301,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun May 07 2017 22:30:12 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Oct 16 2019 13:05:06 GMT+0100 (BST) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Empty file modified docs/fonts/OpenSans-Semibold-webfont.eot
100644 → 100755
Empty file.
Empty file modified docs/fonts/OpenSans-Semibold-webfont.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/fonts/OpenSans-Semibold-webfont.ttf
100644 → 100755
Empty file.
Empty file modified docs/fonts/OpenSans-Semibold-webfont.woff
100644 → 100755
Empty file.
Empty file modified docs/fonts/OpenSans-SemiboldItalic-webfont.eot
100644 → 100755
Empty file.
Empty file modified docs/fonts/OpenSans-SemiboldItalic-webfont.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/fonts/OpenSans-SemiboldItalic-webfont.ttf
100644 → 100755
Empty file.
Empty file modified docs/fonts/OpenSans-SemiboldItalic-webfont.woff
100644 → 100755
Empty file.
11 changes: 6 additions & 5 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h4 class="name" id="authorize"><span class="type-signature"></span>authorize<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line49">line 49</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line57">line 57</a>
</li></ul></dd>


Expand Down Expand Up @@ -468,7 +468,8 @@ <h4 class="name" id="onRedirectUri"><span class="type-signature"></span>onRedire
<p>Handler that must be called with the redirect url the browser tries to open after the OAuth flow is done.
To listen to that event, using cordova-plugin-customurlscheme, you need to register a callback in the method <code>window.handleOpenURL</code></p>
<pre class="prettyprint source"><code>var Auth0Cordova = require('@auth0/cordova');
window.handleOpenURL = Auth0Cordova.onRedirectUri(url);</code></pre>
window.handleOpenURL = Auth0Cordova.onRedirectUri(url);
</code></pre>
</div>


Expand Down Expand Up @@ -504,7 +505,7 @@ <h4 class="name" id="onRedirectUri"><span class="type-signature"></span>onRedire

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line154">line 154</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line175">line 175</a>
</li></ul></dd>


Expand Down Expand Up @@ -641,7 +642,7 @@ <h4 class="name" id="authorizeCallback"><span class="type-signature"></span>auth

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line39">line 39</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line47">line 47</a>
</li></ul></dd>


Expand Down Expand Up @@ -962,7 +963,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun May 07 2017 22:30:12 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Oct 16 2019 13:05:06 GMT+0100 (BST) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
60 changes: 45 additions & 15 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@


<section class="readme">
<article><h1>Auth0 Cordova</h1><p>Library to make it easy to integrate Auth0 login in your Cordova applications.</p>
<h2>Requirements</h2><p>The library requires these two cordova plugins to work:</p>
<article><h1>Auth0 Cordova</h1>
<p>Library to make it easy to integrate Auth0 login in your Cordova applications.</p>
<h2>Requirements</h2>
<p>The library requires these two cordova plugins to work:</p>
<ul>
<li>cordova-plugin-safariviewcontroller: Shows Safari/Chrome browser ViewController/CustomTab</li>
<li>cordova-plugin-customurlscheme: Handles the custom scheme url intents for callback</li>
</ul>
<p>you'll need to run</p>
<pre class="prettyprint source lang-bash"><code>cordova plugin add cordova-plugin-inappbrowser
cordova 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</code></pre><blockquote>
<pre class="prettyprint source lang-bash"><code>cordova plugin add cordova-plugin-safariviewcontroller
cordova 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
</code></pre>
<blockquote>
<p>In cordova applications, the application package name is the widget's identifier in <code>config.xml</code></p>
</blockquote>
<p>So if you have the following values</p>
Expand All @@ -65,14 +69,20 @@ <h2>Requirements</h2><p>The library requires these two cordova plugins to work:<
<li>auth0 domain: samples.auth0.com</li>
</ul>
<p>in your config you should have some entries like</p>
<pre class="prettyprint source lang-xml"><code>&lt;plugin name=&quot;cordova-plugin-customurlscheme&quot; spec=&quot;~4.2.0&quot;>
<pre class="prettyprint source lang-xml"><code>&lt;preference name=&quot;AndroidLaunchMode&quot; value=&quot;singleTask&quot; />
&lt;plugin name=&quot;cordova-plugin-customurlscheme&quot; spec=&quot;~4.2.0&quot;>
&lt;variable name=&quot;URL_SCHEME&quot; value=&quot;com.auth0.cordova.example&quot; />
&lt;variable name=&quot;ANDROID_SCHEME&quot; value=&quot;com.auth0.cordova.example&quot; />
&lt;variable name=&quot;ANDROID_HOST&quot; value=&quot;sample.auth0.com&quot; />
&lt;variable name=&quot;ANDROID_PATHPREFIX&quot; value=&quot;/cordova/com.auth0.cordova.example/callback&quot; />
&lt;/plugin>
&lt;plugin name=&quot;cordova-plugin-safariviewcontroller&quot; spec=&quot;~1.4.6&quot; /></code></pre><h2>Setup</h2><p>From <a href="https://npmjs.org">npm</a></p>
<pre class="prettyprint source lang-sh"><code>npm install @auth0/cordova</code></pre><p>then in your index.js you need to register the url handler <code>ondeviceready</code></p>
&lt;plugin name=&quot;cordova-plugin-safariviewcontroller&quot; spec=&quot;~1.4.6&quot; />
</code></pre>
<h2>Setup</h2>
<p>From <a href="https://npmjs.org">npm</a></p>
<pre class="prettyprint source lang-sh"><code>npm install @auth0/cordova
</code></pre>
<p>then in your index.js you need to register the url handler <code>ondeviceready</code></p>
<pre class="prettyprint source lang-js"><code>var Auth0Cordova = require('@auth0/cordova');

function main() {
Expand All @@ -83,7 +93,10 @@ <h2>Requirements</h2><p>The library requires these two cordova plugins to work:<
// init your application
}

document.addEventListener('deviceready', main);</code></pre><h2>Usage</h2><pre class="prettyprint source lang-js"><code>const auth0 = new Auth0Cordova({
document.addEventListener('deviceready', main);
</code></pre>
<h2>Usage</h2>
<pre class="prettyprint source lang-js"><code>const auth0 = new Auth0Cordova({
domain: &quot;{YOUR_AUTH0_DOMAIN}&quot;,
clientId: &quot;{YOUR_AUTH0_CLIENT_ID}&quot;,
packageIdentifier: &quot;{WIDGET_ID_IN_CONFIG_XML}&quot;
Expand All @@ -93,17 +106,34 @@ <h2>Requirements</h2><p>The library requires these two cordova plugins to work:<
scope: 'openid profile',
};

client.authorize(options, function (err, result) {
auth0.authorize(options, function (err, result) {
if (err) {
// failure
}
// success!
});</code></pre><p>This will open your tenant's hosted login page in the OS browser and will use OAuth 2.0 code grant flow with <a href="https://tools.ietf.org/html/rfc7636">Proof Key for Code Exchange</a>.</p>
<h2>API</h2><p>For more information about our API please check our <a href="https://auth0.github.io/auth0-cordova/">online documentation</a></p>
<h2>Issue Reporting</h2><p>If 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 <a href="https://auth0.com/whitehat">Responsible Disclosure Program</a> details the procedure for disclosing security issues.</p>
});
</code></pre>
<p>This will open your tenant's hosted login page in the OS browser and will use OAuth 2.0 code grant flow with <a href="https://tools.ietf.org/html/rfc7636">Proof Key for Code Exchange</a>.</p>
<h2>API</h2>
<p>For more information about our API please check our <a href="https://auth0.github.io/auth0-cordova/">online documentation</a></p>
<h2>Issue Reporting</h2>
<p>If 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 <a href="https://auth0.com/whitehat">Responsible Disclosure Program</a> details the procedure for disclosing security issues.</p>
<p>For auth0 related questions/support please use the <a href="https://support.auth0.com">Support Center</a>.</p>
<h2>Author</h2><p><a href="auth0.com">Auth0</a></p>
<h2>License</h2><p>This project is licensed under the MIT license. See the <a href="LICENSE.txt">LICENSE</a> file for more info.</p></article>
<h2>Common Issues</h2>
<ol>
<li>
<p>The plugin is not working in Ionic / Cordova dev app.</p>
<p>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.</p>
</li>
<li>
<p>The app hangs after authentication</p>
<p>If 1 does not solve your problem, please make sure you have <code>cordova-plugin-customurlscheme</code> installed or an appropirate plugin to handle the callback (like deeplinks / universal links) and you are handling the callback appropriately</p>
</li>
</ol>
<h2>Author</h2>
<p><a href="auth0.com">Auth0</a></p>
<h2>License</h2>
<p>This project is licensed under the MIT license. See the <a href="LICENSE.txt">LICENSE</a> file for more info.</p></article>
</section>


Expand All @@ -116,7 +146,7 @@ <h2>License</h2><p>This project is licensed under the MIT license. See the <a hr
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun May 07 2017 22:30:12 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Oct 16 2019 13:05:06 GMT+0100 (BST) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
46 changes: 37 additions & 9 deletions docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ <h1 class="page-title">index.js</h1>

var generateProofKey = crypto.generateProofKey;
var generateState = crypto.generateState;
var closingDelayMs = 1000;

session.clean();

var telemetry = {
version: version,
name: 'auth0-cordova',
lib_version: auth0.version
version: version,
env: {
'auth0.js': auth0.version,
os: getOS()
}
};

/**
Expand All @@ -70,7 +74,11 @@ <h1 class="page-title">index.js</h1>
this.clientId = options.clientId;
this.domain = options.domain;
this.redirectUri = options.packageIdentifier + '://' + options.domain + '/cordova/' + options.packageIdentifier + '/callback';
this.client = new auth0.Authentication({
this.auth0 = new auth0.WebAuth({
clientID: this.clientId,
domain: this.domain
});
this.client = new auth0.Authentication(this.auth0, {
clientID: this.clientId,
domain: this.domain,
_telemetryInfo: telemetry
Expand Down Expand Up @@ -134,9 +142,21 @@ <h1 class="page-title">index.js</h1>
return callback(error);
}

if (result.event === 'closed' &amp;&amp; getOS() === 'ios') {
session.clean();
return callback(new Error('user canceled'));
if (result.event === 'closed') {
var handleClose = function () {
if (session.isClosing) {
session.clean();
return callback(new Error('user canceled'));
}
};

session.closing();
if (getOS() === 'ios') {
handleClose();
} else {
setTimeout(handleClose, closingDelayMs);
return;
}
}

if (result.event !== 'loaded') {
Expand Down Expand Up @@ -173,13 +193,14 @@ <h1 class="page-title">index.js</h1>

var code = response.code;
var verifier = keys.codeVerifier;
agent.close();

client.oauthToken({
code_verifier: verifier,
grantType: 'authorization_code',
redirectUri: redirectUri,
code: code
}, function (exchangeError, exchangeResult) {
agent.close();
if (exchangeError) {
return callback(exchangeError);
}
Expand All @@ -204,7 +225,14 @@ <h1 class="page-title">index.js</h1>
* @param {String} url with a custom scheme relied to the application
*/
CordovaAuth.onRedirectUri = function (url) {
session.onRedirectUri(url);
// If we are running in UIWebView we need to wait
if (window.webkit &amp;&amp; window.webkit.messageHandlers) {
return session.onRedirectUri(url);
}

return setTimeout(function () {
session.onRedirectUri(url);
}, 4);
};

CordovaAuth.version = version;
Expand All @@ -222,7 +250,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun May 07 2017 22:30:12 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Oct 16 2019 13:05:06 GMT+0100 (BST) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@auth0/cordova",
"version": "0.3.0",
"version": "0.4.0",
"description": "Auth0 integration for Cordova applications",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { raw: '0.3.0' };
module.exports = { raw: '0.4.0' };

0 comments on commit 07140f4

Please sign in to comment.