Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Jul 15, 2019
1 parent fed7758 commit 3e0a3fd
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 45 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log

## [v1.5.0](https://github.com/auth0/react-native-auth0/tree/v1.5.0) (2019-07-15)

[Full Changelog](https://github.com/auth0/react-native-auth0/compare/v1.4.2...v1.5.0)

**Changed**

- Enable WebAuth Logout for Android & Fix iOS Logout. [\#223](https://github.com/auth0/react-native-auth0/pull/223) ([lbalmaceda](https://github.com/lbalmaceda))

**Fixed**

- Fix error handling by using authentication error class [\#228](https://github.com/auth0/react-native-auth0/pull/228) ([lbalmaceda](https://github.com/lbalmaceda))

## [v1.4.2](https://github.com/auth0/react-native-auth0/tree/v1.4.2) (2019-04-24)

[Full Changelog](https://github.com/auth0/react-native-auth0/compare/v1.4.2...v1.4.2)
Expand Down
2 changes: 1 addition & 1 deletion docs/Auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -2638,7 +2638,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Auth0.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ <h3 class="subsection-title">Classes</h3>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Auth0.module.exports.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Users.html
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
12 changes: 6 additions & 6 deletions docs/WebAuth.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h4 class="name" id="WebAuth"><span class="type-signature"></span>new WebAuth<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line10">line 10</a>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line16">line 16</a>
</li></ul></dd>


Expand Down Expand Up @@ -212,7 +212,7 @@ <h4 class="name" id=".authorize"><span class="type-signature">(static) </span>au

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line48">line 48</a>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line54">line 54</a>
</li></ul></dd>


Expand Down Expand Up @@ -546,8 +546,8 @@ <h4 class="name" id=".clearSession"><span class="type-signature">(static) </span


<div class="description">
<p>Removes Auth0 session and optionally remove the Identity Provider session.
In iOS it will use <code>SFSafariViewController</code></p>
<p>Removes Auth0 session and optionally remove the Identity Provider session.</p>
<p> In iOS it will use <code>SFSafariViewController</code> and in Android Chrome Custom Tabs.</p>
</div>


Expand Down Expand Up @@ -583,7 +583,7 @@ <h4 class="name" id=".clearSession"><span class="type-signature">(static) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line105">line 105</a>
<a href="webauth_index.js.html">webauth/index.js</a>, <a href="webauth_index.js.html#line109">line 109</a>
</li></ul></dd>


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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/auth_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ <h1 class="page-title">auth/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
13 changes: 9 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2>Installation</h2><p>Install <code>react-native-auth0</code> using <a href="h
<pre class="prettyprint source lang-bash"><code>npm install react-native-auth0 --save</code></pre><p>Or via <a href="https://yarnpkg.com/en/package/jest">yarn</a></p>
<pre class="prettyprint source lang-bash"><code>yarn add react-native-auth0</code></pre><p>then you need to link the native module in <code>react-native-auth0</code></p>
<pre class="prettyprint source lang-bash"><code>react-native link react-native-auth0</code></pre><h3>Configuration</h3><blockquote>
<p>This section is for those that want to use <a href="#webauth">WebAuth</a>, if you dont need it just ignore this section.</p>
<p>This section is for those that want to use <a href="#web-authentication">Web Authentication</a>, if you dont need it just ignore this section.</p>
</blockquote>
<h4>Android</h4><p>In the file <code>android/app/src/main/AndroidManifest.xml</code> you must make sure the <strong>MainActivity</strong> of the app has a <strong>launchMode</strong> value of <code>singleTask</code> and that it has the following intent filter:</p>
<pre class="prettyprint source lang-xml"><code>&lt;intent-filter>
Expand Down Expand Up @@ -120,6 +120,8 @@ <h4>iOS</h4><p>Inside the <code>ios</code> folder find the file <code>AppDelegat
&lt;/array></code></pre><p>The <code>&lt;string&gt;</code> value should be the literal value of the Bundle Identifier with no $ variables, for example: <code>samples.auth0.com</code>.</p>
<blockquote>
<p>The value <code>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</code> is the default for apps created with React Native CLI, you may have a different value.</p>
</blockquote>
<blockquote>
<p>For more info please read <a href="https://facebook.github.io/react-native/docs/linking.html">react native docs</a></p>
</blockquote>
<h3>Callback URL(s)</h3><p>Callback URLs are the URLs that Auth0 invokes after the authentication process. Auth0 routes your application back to this URL and appends additional parameters to it, including a token. Since callback URLs can be manipulated, you will need to add this URL to your Application's <strong>Allowed Callback URLs</strong> for security. This will enable Auth0 to recognize these URLs as valid. If omitted, authentication will not be successful.</p>
Expand All @@ -129,14 +131,17 @@ <h3>Callback URL(s)</h3><p>Callback URLs are the URLs that Auth0 invokes after t
<p>Go to the <a href="https://manage.auth0.com/#/applications">Auth0 Dashboard</a>, select your application and make sure that <strong>Allowed Callback URLs</strong> contains the following:</p>
<h4>iOS</h4><pre class="prettyprint source lang-text"><code>{YOUR_BUNDLE_IDENTIFIER}://${YOUR_AUTH0_DOMAIN}/ios/{YOUR_BUNDLE_IDENTIFIER}/callback</code></pre><h4>Android</h4><pre class="prettyprint source lang-text"><code>{YOUR_APP_PACKAGE_NAME}://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback</code></pre><h2>Usage</h2><pre class="prettyprint source lang-js"><code>import Auth0 from 'react-native-auth0';

const auth0 = new Auth0({ domain: '{YOUR_AUTH0_DOMAIN}', clientId: '{YOUR_CLIENT_ID}' });</code></pre><h3>WebAuth</h3><pre class="prettyprint source lang-js"><code>auth0
const auth0 = new Auth0({ domain: '{YOUR_AUTH0_DOMAIN}', clientId: '{YOUR_CLIENT_ID}' });</code></pre><h3>Web Authentication</h3><h4>Log in</h4><pre class="prettyprint source lang-js"><code>auth0
.webAuth
.authorize({scope: 'openid email', audience: 'https://{YOUR_AUTH0_DOMAIN}/userinfo'})
.then(credentials => console.log(credentials))
.catch(error => console.log(error));</code></pre><blockquote>
<p>This snippet sets the <code>audience</code> to ensure OIDC compliant responses, this can also be achieved by enabling the <strong>OIDC Conformant</strong> switch in your Auth0 dashboard under <code>Application / Settings / Advanced OAuth</code>. For more information please check <a href="https://auth0.com/docs/api-auth/intro#how-to-use-the-new-flows">this documentation</a>.</p>
</blockquote>
<h3>Authentication API</h3><h3>Important: Database Connection Authentication</h3><p>Since June 2017 new Clients no longer have the <strong>Password Grant Type*</strong> enabled by default.
<h4>Log out</h4><pre class="prettyprint source lang-js"><code>auth0
.webAuth
.clearSession()
.catch(error => console.log(error));</code></pre><h3>Authentication API</h3><h3>Important: Database Connection Authentication</h3><p>Since June 2017 new Clients no longer have the <strong>Password Grant Type*</strong> enabled by default.
If you are accessing a Database Connection using <code>passwordRealm</code> then you will need to enable the Password Grant Type, please follow <a href="https://auth0.com/docs/clients/client-grant-types#how-to-edit-the-client-grant_types-property">this guide</a>.</p>
<h4>Login with Password Realm Grant</h4><pre class="prettyprint source lang-js"><code>auth0
.auth
Expand Down Expand Up @@ -192,7 +197,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.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/management_users.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h1 class="page-title">management/users.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
41 changes: 17 additions & 24 deletions docs/webauth_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ <h1 class="page-title">webauth/index.js</h1>
import { NativeModules, Platform } from 'react-native';

import url from 'url';
import Auth0Error from '../auth/auth0Error';
import AuthError from '../auth/authError';

const { A0Auth0 } = NativeModules;

const callbackUri = domain => {
const bundleIdentifier = A0Auth0.bundleIdentifier;
return `${bundleIdentifier.toLowerCase()}://${domain}/${
Platform.OS
}/${bundleIdentifier}/callback`;
};

/**
* Helper to perform Auth against Auth0 hosted login page
*
Expand Down Expand Up @@ -89,18 +95,15 @@ <h1 class="page-title">webauth/index.js</h1>
authorize(options = {}) {
const { clientId, domain, client, agent } = this;
return agent.newTransaction().then(({ state, verifier, ...defaults }) => {
const bundleIdentifier = A0Auth0.bundleIdentifier;
const redirectUri = `${bundleIdentifier.toLowerCase()}://${domain}/${
Platform.OS
}/${bundleIdentifier}/callback`;
const redirectUri = callbackUri(domain);
const expectedState = options.state || state;
let query = {
...defaults,
clientId,
responseType: 'code',
redirectUri,
state: expectedState,
...options,
...options
};
const authorizeUrl = this.client.authorizeUrl(query);
return agent.show(authorizeUrl).then(redirectUrl => {
Expand All @@ -116,7 +119,7 @@ <h1 class="page-title">webauth/index.js</h1>
const query = url.parse(redirectUrl, true).query;
const { code, state: resultState, error } = query;
if (error) {
throw new Auth0Error({ json: query, status: 0 });
throw new AuthError({ json: query, status: 0 });
}
if (resultState !== expectedState) {
throw new AuthError({
Expand All @@ -134,7 +137,8 @@ <h1 class="page-title">webauth/index.js</h1>

/**
* Removes Auth0 session and optionally remove the Identity Provider session.
* In iOS it will use `SFSafariViewController`
*
* In iOS it will use `SFSafariViewController` and in Android Chrome Custom Tabs.
*
* @param {Object} parameters parameters to send
* @param {Bool} [parameters.federated] Optionally remove the IdP session.
Expand All @@ -144,21 +148,10 @@ <h1 class="page-title">webauth/index.js</h1>
* @memberof WebAuth
*/
clearSession(options = {}) {
if (Platform.OS !== 'ios') {
return Promise.reject(
new AuthError({
json: {
error: 'a0.platform.not_available',
error_description: `Cannot perform operation in platform ${
Platform.OS
}`
},
status: 0
})
);
}
const { client, agent } = this;
const federated = options.federated || false;
const { client, agent, domain, clientId } = this;
options.clientId = clientId;
options.returnTo = callbackUri(domain);
options.federated = options.federated || false;
const logoutUrl = client.logoutUrl(options);
return agent.show(logoutUrl, true);
}
Expand All @@ -175,7 +168,7 @@ <h1 class="page-title">webauth/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 24 2019 16:21:16 GMT-0300 (-03) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 2 additions & 2 deletions networking/telemetry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated file by lbalmaceda on Wed Apr 24 2019 16:21:16 GMT-0300 (-03);
// Generated file by lbalmaceda on Mon Jul 15 2019 14:20:17 GMT-0300 (Argentina Standard Time);
module.exports = {
name: 'react-native-auth0',
version: '1.4.2'
version: '1.5.0'
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-auth0",
"version": "1.4.2",
"version": "1.5.0",
"description": "React Native toolkit for Auth0 API",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 3e0a3fd

Please sign in to comment.