Skip to content

Commit

Permalink
Upgrade to 1.8.10 - fix issue #218
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Murin committed May 13, 2024
1 parent 748c990 commit 4d9ff36
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 74 deletions.
2 changes: 1 addition & 1 deletion docs/Auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h4 class="name" id="Client"><span class="type-signature"></span>new Client<span
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer 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 @@ -304,7 +304,7 @@ <h1 class="page-title">auth/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
12 changes: 6 additions & 6 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h3 class="subsection-title">Methods</h3>



<h4 class="name" id="extractIdToken"><span class="type-signature"></span>extractIdToken<span class="signature">(encoded)</span><span class="type-signature"> &rarr; {Object|null}</span></h4>
<h4 class="name" id="extractIdToken"><span class="type-signature"></span>extractIdToken<span class="signature">(encodedIdToken)</span><span class="type-signature"> &rarr; {Object|null}</span></h4>



Expand Down Expand Up @@ -160,7 +160,7 @@ <h4 class="name" id="extractIdToken"><span class="type-signature"></span>extract

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="token_token.js.html">token/token.js</a>, <a href="token_token.js.html#line18">line 18</a>
<a href="token_token.js.html">token/token.js</a>, <a href="token_token.js.html#line9">line 9</a>
</li></ul></dd>


Expand Down Expand Up @@ -204,7 +204,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>encoded</code></td>
<td class="name"><code>encodedIdToken</code></td>


<td class="type">
Expand All @@ -221,7 +221,7 @@ <h5>Parameters:</h5>


<td class="description last">
<p>IdToken string</p>
<p>string</p>

</td>
</tr>
Expand Down Expand Up @@ -266,7 +266,7 @@ <h5>Returns:</h5>

<div class="param-desc">
<ul>
<li>in cas of error null is returned</li>
<li>in case of error null is returned</li>
</ul>
</div>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
12 changes: 10 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,17 @@ <h3>App Registration</h3>
<li>Find the <em>Application (client) ID</em> value in <strong>Overview</strong> section, copy and save the value in a safe location.</li>
<li>You don't need to set <em>API Permissions</em>. It is meant for admin consent only.</li>
<li>Now select <strong>Authentication</strong> from the left menu</li>
<li>Select checkbox <strong>ID tokens</strong> in the <em>Implicit grant</em> section - it is needed for OpenID Connect. The library will still use authorization grant and not imlicit.</li>
<li>Select checkbox <strong>ID tokens</strong>[^implicitgrantnote] in the <em>Implicit grant</em> section - it is needed for OpenID Connect. The library will still use authorization grant and not implicit.</li>
<li>Click <strong>Save</strong> button above to save changes.</li>
</ol>
<p>[^implicitgrantnote]: This checkbox <a href="https://github.com/vmurin/react-native-azure-auth/issues/174">might not exist (anymore)</a>.</p>
<pre><code>If this is the case, go to **Manifest** and set the following values to true:

```json
&quot;oauth2AllowIdTokenImplicitFlow&quot;: true,
&quot;oauth2AllowImplicitFlow&quot;: true,
```
</code></pre>
<h4>Callback URL(s)</h4>
<p>Callback URLs are the URIs that Azure AD invokes after the authentication process. Azure routes your application back to this URI and appends additional parameters to it, including a token. Since callback URLs can be manipulated, you will need to add your application's URL to your apps's registered <strong>Redirect-URIs</strong>. This will enable Azure to recognize these URLs as valid. If omitted, authentication will not be successful.</p>
<h5>iOS - default redirect URI structure</h5>
Expand Down Expand Up @@ -264,7 +272,7 @@ <h2>License</h2>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer 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 @@ -91,7 +91,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
50 changes: 7 additions & 43 deletions docs/token_token.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,61 +39,25 @@ <h1 class="page-title">token/token.js</h1>

<section>
<article>
<pre class="prettyprint source linenums"><code>import { Base64 } from 'js-base64'
import log from '../utils/logger'

function base64DecodeStringUrlSafe(base64IdToken) {
return decodeURIComponent(Base64.decode(base64IdToken))
}

function isEmptyString(str) {
return (typeof str === 'undefined' || !str || 0 === str.length)
}
<pre class="prettyprint source linenums"><code>import {jwtDecode} from 'jwt-decode'

/**
* Decode ID token from
*
* @param {string} encoded IdToken string
* @returns {Object | null} - in cas of error null is returned
* @param {string} encodedIdToken string
* @returns {Object | null} - in case of error null is returned
*/
export function extractIdToken(encodedIdToken) {
// id token will be decoded to get the username
const decodedToken = _decodeJwt(encodedIdToken)
const decodedToken = jwtDecode(encodedIdToken)
if (!decodedToken) {
return null
}
try {
const base64IdToken = decodedToken.JWSPayload
const base64Decoded = base64DecodeStringUrlSafe(base64IdToken)
if (!base64Decoded) {
log.info('The returned id_token could not be base64 url safe decoded.')
return null
}
return JSON.parse(base64Decoded)
} catch (err) {
log.error('The returned id_token could not be decoded', err)
}

return null
return decodedToken
}

function _decodeJwt(jwtToken) {
if (isEmptyString(jwtToken)) {
return null
}
const idTokenPartsRegex = /^([^.\s]*)\.([^.\s]+)\.([^.\s]*)$/
const matches = idTokenPartsRegex.exec(jwtToken)
if (!matches || matches.length &lt; 4) {
log.warn('The returned id_token is not parseable.')
return null
}
const crackedToken = {
header: matches[1],
JWSPayload: matches[2],
JWSSig: matches[3]
}
return crackedToken
}</code></pre>
</code></pre>
</article>
</section>

Expand All @@ -105,7 +69,7 @@ <h1 class="page-title">token/token.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) using the Minami theme.
</footer>

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

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Aug 17 2023 20:58:19 GMT+0200 (Central European Summer Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon May 13 2024 17:27:04 GMT+0200 (Central European Summer Time) 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": "react-native-azure-auth",
"version": "1.8.9",
"version": "1.8.10",
"description": "An React Native module implements Azure AD V2.0 authentication flow",
"main": "src/index.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit 4d9ff36

Please sign in to comment.