Skip to content

Commit 93e7b95

Browse files
committed
chore: prepare 9.1 release
1 parent f28a2ce commit 93e7b95

32 files changed

+2900
-2452
lines changed

Diff for: CHANGELOG.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4-
53
## 9.1.0 (2020-03-23)
64

75

@@ -26,4 +24,8 @@ All notable changes to this project will be documented in this file. See [standa
2624
* run tokensetup outside ngzone ([07bb62d](https://github.com/manfredsteyer/angular-oauth2-oidc/commit/07bb62d06abb84ef2da010977d07bfd2a3805b16))
2725
* typo ([3d331f2](https://github.com/manfredsteyer/angular-oauth2-oidc/commit/3d331f2166340db43f0aaca42ce8abc4913cd027))
2826

29-
### [9.0.2](https://github.com/manfredsteyer/angular-oauth2-oidc/compare/v9.0.1...v9.0.2) (2020-03-23)
27+
### Thanks
28+
29+
Big Thanks to all contributers: Brecht Carlier, Daniel Moos, Jie Lin, Manfred Steyer, Phil McCloghry-Laing, robin labat, vdveer
30+
31+
Also, big thanks to jeroenheijmans for doing an awesome job with moderating and analyzing the issues!

Diff for: docs/additional-documentation/popup-based-login.html

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ <h1 id="logging-in-with-a-popup">Logging in With a Popup</h1>
5555
<li>Create and configure a <code>silent-refresh.html</code> as described <a href="./silent-refresh.html">here</a> *.</li>
5656
</ul>
5757
<p>* Please note this does not mean that you have to use silent refresh too.</p>
58+
<p>Also, for your <code>silent-regfesh.html</code>, make sure you are also targeting
59+
<code>window.opener</code> and fall back to <code>window.parent</code>:</p>
60+
<p><strong>Please note</strong>: IE sets opener to null under specific security settings. This prevents making this work.</p>
5861

5962
</div><div class="search-results">
6063
<div class="has-results">

Diff for: docs/additional-documentation/session-checks.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ <h2 id="configuration">Configuration</h2>
6969

7070
// Activate Session Checks:
7171
sessionChecksEnabled: true,
72-
}</code></pre></div><h2 id="events">Events</h2>
72+
}</code></pre></div><h2 id="refresh">Refresh</h2>
73+
<p>Please note that the lib performs a token refresh when the session changes to get the newest information about the current session. When using implicit flow, this means you have to configure <a href="./silent-refresh.html">silent refresh</a>; when using code flow you either need silent refresh or a <a href="./refreshing-a-token.html">refresh token</a>.</p>
74+
<p>If using refresh tokens, your Auth Server needs to bind them to the current session&#39;s lifetime. Unfortunately, the used version of Identity Server 4, shown in the docs and in the example applications, does not support this at the moment.</p>
75+
<h2 id="events">Events</h2>
7376
<p>To get notified, you can hook up for the event <code>session_terminated</code>:</p>
7477
<div><pre class="line-numbers"><code class="language-TypeScript">this.oauthService.events.pipe(filter(e =&gt; e.type === &#39;session_terminated&#39;)).subscribe(e =&gt; {
7578
console.debug(&#39;Your session has been terminated!&#39;);

Diff for: docs/additional-documentation/silent-refresh.html

+20
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ <h2 id="refreshing-when-using-implicit-flow-implicit-flow-and-code-flow">Refresh
8888
(window.opener || window.parent).postMessage(location.hash || (&#39;#&#39; + location.search), location.origin);
8989
&lt;/script&gt;
9090
&lt;/body&gt;
91+
&lt;/html&gt;</code></pre></div><p>This simple implementation within silent-refresh.html is sufficient in most cases. It takes care of the hash fragment as well as of the query string (property search). For <strong>edge cases</strong> you need to check if the received hash fragment is a token response. For this, please go with the following <strong>more advanced implementation</strong>:</p>
92+
<div><pre class="line-numbers"><code class="language-html">&lt;html&gt;
93+
&lt;body&gt;
94+
&lt;script&gt;
95+
var checks = [/[\?|&amp;|#]code=/, /[\?|&amp;|#]error=/, /[\?|&amp;|#]token=/, /[\?|&amp;|#]id_token=/];
96+
97+
function isResponse(str) {
98+
var count = 0;
99+
if (!str) return false;
100+
for(var i=0; i&lt;checks.length; i++) {
101+
if (str.match(checks[i])) return true;
102+
}
103+
return false;
104+
}
105+
106+
var message = isResponse(location.hash) ? location.hash : &#39;#&#39; + location.search;
107+
108+
(window.opener || window.parent).postMessage(message, location.origin);
109+
&lt;/script&gt;
110+
&lt;/body&gt;
91111
&lt;/html&gt;</code></pre></div><p>Please make sure that this file is copied to your output directory by your build task. When using the CLI you can define it as an asset for this. For this, you have to add the following line to the file <code>.angular-cli.json</code>:</p>
92112
<div><pre class="line-numbers"><code class="language-JSON">&quot;assets&quot;: [
93113
[...],

Diff for: docs/changelog.html

+25-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,31 @@
3030
<div class="content getting-started">
3131
<div class="content-data">
3232

33-
<h1 id="change-log">Change Log</h1>
34-
<h2 id="lates-features">Lates features</h2>
35-
<p>See <a href="https://github.com/manfredsteyer/angular-oauth2-oidc/releases">Release Notes</a> for details on each release.</p>
36-
<h2 id="older-versions">Older versions</h2>
37-
<p>Since Angular 5, versions of this library matched up with the Angular version.
38-
So versions 5.x were released while Angular 5 was out, the 6.x versions during Angular 6, etc.
39-
If you need to support a specific old version of Angular, you can consider using a version of the library that lines up.</p>
40-
<p>For older release notes check the repository version history, or above-linked release notes.
41-
For even older versions, check out <a href="https://github.com/manfredsteyer/angular-oauth2-oidc/blob/5d676101c6118d6fa01bfa05b17fb4a58490eaf7/CHANGELOG.md">the old change log</a>.</p>
33+
<h1 id="changelog">Changelog</h1>
34+
<h2 id="910-2020-03-23">9.1.0 (2020-03-23)</h2>
35+
<h3 id="features">Features</h3>
36+
<ul>
37+
<li>remove jsrsasign dependancy (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/77cb37abfd08762a59b221257ed8d5d5b7c795d4">77cb37a</a>)</li>
38+
<li>Upgrade to angular 8 (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/31c6273b388af7e796a9ad663e346f1e33ff331c">31c6273</a>)</li>
39+
<li><strong>automatic silent refresh:</strong> stopAutomaticRefresh stops all timers. (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/8ab853bf38dd162060d7b6cbd18f7b4fd5a84f18">8ab853b</a>)</li>
40+
<li><strong>code-flow:</strong> allow using implicit flow by setting useSilentRefresh to true (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/93902a5808bb9b75a41d4bde44c6ab763bcfa9f6">93902a5</a>)</li>
41+
<li><strong>sample:</strong> also use new idsvr 4 for implicit flow demo to prevent issues with same site cookies (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/58c63541bc7d83d72c30577da2b68ac2d1dc35b7">58c6354</a>)</li>
42+
<li><strong>session checks:</strong> Session checks work now for code flow too. Pls see Docs for details. (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/4bf89014d8cc5d50ed716500e3f3ad265b4ae2db">4bf8901</a>)</li>
43+
</ul>
44+
<h3 id="bug-fixes">Bug Fixes</h3>
45+
<ul>
46+
<li><strong>code flow:</strong> Fixed code flow for IE 11 (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/0f03d393aac9fe4e26444a73884dd154318d530f">0f03d39</a>)</li>
47+
<li><strong>sample:</strong> use hash-based routing (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/3f44ecae157305c56ae377fcd6d2df8dfde8adf5">3f44eca</a>)</li>
48+
<li><strong>session state:</strong> save session_state also when using code flow (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/8fa99ff721ea2b08f28bc5e9fa3e48a459e2a59a">8fa99ff</a>)</li>
49+
<li><strong>state:</strong> passing an url with a querystring as the state, e. g. url?x=1 (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/71b705cb5105f6dfb49aabc55607745b881c5dc3">71b705c</a>)</li>
50+
<li><a href="https://github.com/manfredsteyer/angular-oauth2-oidc/issues/687">#687</a> (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/e2599e071307ae1efe1592c83bb3b7a01642a61d">e2599e0</a>)</li>
51+
<li>missing HttpModule dependency (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/7eac8ae5cd1fd549f3933c30790f4b802c2c09f0">7eac8ae</a>)</li>
52+
<li>run tokensetup outside ngzone (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/07bb62d06abb84ef2da010977d07bfd2a3805b16">07bb62d</a>)</li>
53+
<li>typo (<a href="https://github.com/manfredsteyer/angular-oauth2-oidc/commit/3d331f2166340db43f0aaca42ce8abc4913cd027">3d331f2</a>)</li>
54+
</ul>
55+
<h3 id="thanks">Thanks</h3>
56+
<p>Big Thanks to all contributers: Brecht Carlier, Daniel Moos, Jie Lin, Manfred Steyer, Phil McCloghry-Laing, robin labat, vdveer</p>
57+
<p>Also, big thanks to jeroenheijmans for doing an awesome job with moderating and analyzing the issues!</p>
4258

4359

4460

Diff for: docs/classes/AbstractValidationHandler.html

+15-10
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ <h3 id="methods">
156156

157157
<tr>
158158
<td class="col-md-4">
159-
<div class="io-line">Defined in <a href="" data-line="86"
160-
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:86</a></div>
159+
<div class="io-line">Defined in <a href="" data-line="88"
160+
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:88</a></div>
161161
</td>
162162
</tr>
163163

@@ -243,8 +243,8 @@ <h3 id="methods">
243243

244244
<tr>
245245
<td class="col-md-4">
246-
<div class="io-line">Defined in <a href="" data-line="69"
247-
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:69</a></div>
246+
<div class="io-line">Defined in <a href="" data-line="71"
247+
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:71</a></div>
248248
</td>
249249
</tr>
250250

@@ -323,8 +323,8 @@ <h3 id="methods">
323323

324324
<tr>
325325
<td class="col-md-4">
326-
<div class="io-line">Defined in <a href="" data-line="44"
327-
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:44</a></div>
326+
<div class="io-line">Defined in <a href="" data-line="46"
327+
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:46</a></div>
328328
</td>
329329
</tr>
330330

@@ -397,8 +397,8 @@ <h3 id="methods">
397397

398398
<tr>
399399
<td class="col-md-4">
400-
<div class="io-line">Defined in <a href="" data-line="39"
401-
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:39</a></div>
400+
<div class="io-line">Defined in <a href="" data-line="41"
401+
class="link-to-prism">projects/lib/src/token-validation/validation-handler.ts:41</a></div>
402402
</td>
403403
</tr>
404404

@@ -483,7 +483,9 @@ <h3 id="methods">
483483
/**
484484
* Validates the at_hash in an id_token against the received access_token.
485485
*/
486-
public abstract validateAtHash(validationParams: ValidationParams): Promise&lt;boolean&gt;;
486+
public abstract validateAtHash(
487+
validationParams: ValidationParams
488+
): Promise&lt;boolean&gt;;
487489
}
488490

489491
/**
@@ -542,7 +544,10 @@ <h3 id="methods">
542544
* @param valueToHash
543545
* @param algorithm
544546
*/
545-
protected abstract calcHash(valueToHash: string, algorithm: string): Promise&lt;string&gt;;
547+
protected abstract calcHash(
548+
valueToHash: string,
549+
algorithm: string
550+
): Promise&lt;string&gt;;
546551
}
547552
</code></pre>
548553
</div>

Diff for: docs/classes/AuthConfig.html

+12-8
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,12 @@ <h3 id="inputs">
972972
</span>
973973
</td>
974974
</tr>
975+
<tr>
976+
<td class="col-md-4">
977+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function" target="_blank" >function</a></code>
978+
979+
</td>
980+
</tr>
975981
<tr>
976982
<td class="col-md-4">
977983
<i>Default value : </i><code>() &#x3D;&gt; {...}</code>
@@ -1914,7 +1920,7 @@ <h3 id="inputs">
19141920

19151921
<tr>
19161922
<td class="col-md-4">
1917-
<div class="io-description"><p>Set this to true to use HTTP BASIC auth for password flow</p>
1923+
<div class="io-description"><p>Set this to true to use HTTP BASIC auth for AJAX calls</p>
19181924
</div>
19191925
</td>
19201926
</tr>
@@ -2157,7 +2163,7 @@ <h3 id="inputs">
21572163
* the verbosity of the console needs to be explicitly set
21582164
* to include Debug level messages.
21592165
*/
2160-
public showDebugInformation? &#x3D; false;
2166+
public showDebugInformation? &#x3D; false;
21612167

21622168
/**
21632169
* The redirect uri used when doing silent refresh.
@@ -2292,7 +2298,7 @@ <h3 id="inputs">
22922298
public nonceStateSeparator? &#x3D; &#x27;;&#x27;;
22932299

22942300
/**
2295-
* Set this to true to use HTTP BASIC auth for password flow
2301+
* Set this to true to use HTTP BASIC auth for AJAX calls
22962302
*/
22972303
public useHttpBasicAuth? &#x3D; false;
22982304

@@ -2303,7 +2309,7 @@ <h3 id="inputs">
23032309

23042310
/**
23052311
* The interceptors waits this time span if there is no token
2306-
*/
2312+
*/
23072313
public waitForTokenInMsec? &#x3D; 0;
23082314

23092315
/**
@@ -2332,11 +2338,9 @@ <h3 id="inputs">
23322338
* allowing a way for implementations to specify their own method of routing to new
23332339
* urls.
23342340
*/
2335-
public openUri?: ((uri: string) &#x3D;&gt; void) &#x3D; uri &#x3D;&gt; {
2341+
public openUri?: (uri: string) &#x3D;&gt; void &#x3D; uri &#x3D;&gt; {
23362342
location.href &#x3D; uri;
2337-
}
2338-
2339-
2343+
};
23402344
}
23412345
</code></pre>
23422346
</div>

Diff for: docs/classes/HashHandler.html

+55-41
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ <h3 id="methods">
134134

135135
<tr>
136136
<td class="col-md-4">
137-
<div class="io-line">Defined in <a href="" data-line="7"
138-
class="link-to-prism">projects/lib/src/token-validation/hash-handler.ts:7</a></div>
137+
<div class="io-line">Defined in <a href="" data-line="9"
138+
class="link-to-prism">projects/lib/src/token-validation/hash-handler.ts:9</a></div>
139139
</td>
140140
</tr>
141141

@@ -206,54 +206,68 @@ <h3 id="methods">
206206
<div class="tab-pane fade tab-source-code" id="c-source">
207207
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@angular/core&#x27;;
208208

209+
import { sha256 } from &#x27;js-sha256&#x27;;
210+
209211
/**
210212
* Abstraction for crypto algorithms
211-
*/
213+
*/
212214
export abstract class HashHandler {
213-
abstract calcHash(valueToHash: string, algorithm: string): Promise&lt;string&gt;;
215+
abstract calcHash(valueToHash: string, algorithm: string): Promise&lt;string&gt;;
214216
}
215217

216218
@Injectable()
217219
export class DefaultHashHandler implements HashHandler {
218-
219-
async calcHash(valueToHash: string, algorithm: string): Promise&lt;string&gt; {
220-
const encoder &#x3D; new TextEncoder();
221-
const data &#x3D; encoder.encode(valueToHash);
222-
const hashArray &#x3D; await window.crypto.subtle.digest(algorithm, data);
223-
return this.toHashString(hashArray);
220+
async calcHash(valueToHash: string, algorithm: string): Promise&lt;string&gt; {
221+
// const encoder &#x3D; new TextEncoder();
222+
// const hashArray &#x3D; await window.crypto.subtle.digest(algorithm, data);
223+
// const data &#x3D; encoder.encode(valueToHash);
224+
225+
const hashArray &#x3D; sha256.array(valueToHash);
226+
// const hashString &#x3D; this.toHashString(hashArray);
227+
const hashString &#x3D; this.toHashString2(hashArray);
228+
229+
return hashString;
230+
}
231+
232+
toHashString2(byteArray: number[]) {
233+
let result &#x3D; &#x27;&#x27;;
234+
for (let e of byteArray) {
235+
result +&#x3D; String.fromCharCode(e);
224236
}
225-
226-
toHashString(buffer: ArrayBuffer) {
227-
const byteArray &#x3D; new Uint8Array(buffer);
228-
let result &#x3D; &#x27;&#x27;;
229-
for (let e of byteArray) {
230-
result +&#x3D; String.fromCharCode(e);
231-
}
232-
return result;
237+
return result;
238+
}
239+
240+
toHashString(buffer: ArrayBuffer) {
241+
const byteArray &#x3D; new Uint8Array(buffer);
242+
let result &#x3D; &#x27;&#x27;;
243+
for (let e of byteArray) {
244+
result +&#x3D; String.fromCharCode(e);
233245
}
234-
235-
// hexString(buffer) {
236-
// const byteArray &#x3D; new Uint8Array(buffer);
237-
// const hexCodes &#x3D; [...byteArray].map(value &#x3D;&gt; {
238-
// const hexCode &#x3D; value.toString(16);
239-
// const paddedHexCode &#x3D; hexCode.padStart(2, &#x27;0&#x27;);
240-
// return paddedHexCode;
241-
// });
242-
243-
// return hexCodes.join(&#x27;&#x27;);
244-
// }
245-
246-
// toHashString(hexString: string) {
247-
// let result &#x3D; &#x27;&#x27;;
248-
// for (let i &#x3D; 0; i &lt; hexString.length; i +&#x3D; 2) {
249-
// let hexDigit &#x3D; hexString.charAt(i) + hexString.charAt(i + 1);
250-
// let num &#x3D; parseInt(hexDigit, 16);
251-
// result +&#x3D; String.fromCharCode(num);
252-
// }
253-
// return result;
254-
// }
255-
256-
}</code></pre>
246+
return result;
247+
}
248+
249+
// hexString(buffer) {
250+
// const byteArray &#x3D; new Uint8Array(buffer);
251+
// const hexCodes &#x3D; [...byteArray].map(value &#x3D;&gt; {
252+
// const hexCode &#x3D; value.toString(16);
253+
// const paddedHexCode &#x3D; hexCode.padStart(2, &#x27;0&#x27;);
254+
// return paddedHexCode;
255+
// });
256+
257+
// return hexCodes.join(&#x27;&#x27;);
258+
// }
259+
260+
// toHashString(hexString: string) {
261+
// let result &#x3D; &#x27;&#x27;;
262+
// for (let i &#x3D; 0; i &lt; hexString.length; i +&#x3D; 2) {
263+
// let hexDigit &#x3D; hexString.charAt(i) + hexString.charAt(i + 1);
264+
// let num &#x3D; parseInt(hexDigit, 16);
265+
// result +&#x3D; String.fromCharCode(num);
266+
// }
267+
// return result;
268+
// }
269+
}
270+
</code></pre>
257271
</div>
258272
</div>
259273

Diff for: docs/classes/JwksValidationHandler.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,12 @@ <h3 id="methods">
325325
* to an library of its own, namely angular-oauth2-oidc-utils
326326
*/
327327
export class JwksValidationHandler extends NullValidationHandler {
328-
329328
constructor() {
330329
super();
331330
console.error(err);
332331
}
333-
334-
}</code></pre>
332+
}
333+
</code></pre>
335334
</div>
336335
</div>
337336

Diff for: docs/classes/LoginOptions.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ <h3 id="inputs">
404404

405405

406406
<div class="tab-pane fade tab-source-code" id="c-source">
407-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &quot;@angular/core&quot;;
407+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@angular/core&#x27;;
408408

409409
/**
410410
* Additional options that can be passed to tryLogin.
@@ -512,7 +512,6 @@ <h3 id="inputs">
512512
setItem(key: string, data: string): void {
513513
this.data.set(key, data);
514514
}
515-
516515
}
517516

518517
/**
@@ -544,7 +543,7 @@ <h3 id="inputs">
544543
*/
545544
export interface TokenResponse {
546545
access_token: string;
547-
id_token: string;
546+
id_token: string;
548547
token_type: string;
549548
expires_in: number;
550549
refresh_token: string;

0 commit comments

Comments
 (0)