-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac931de
commit d95d7da
Showing
25 changed files
with
10,958 additions
and
13,638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
!.vscode/extensions.json | ||
|
||
# misc | ||
/.angular/cache | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title>angular-oauth2-oidc</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico"> | ||
<link rel="stylesheet" href="../styles/style.css"> | ||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> | ||
</head> | ||
<body> | ||
|
||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> | ||
<a href="../" class="navbar-brand">angular-oauth2-oidc</a> | ||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button> | ||
</div> | ||
|
||
<div class="xs-menu menu" id="mobile-menu"> | ||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu> | ||
</div> | ||
|
||
<div class="container-fluid main"> | ||
<div class="row main"> | ||
<div class="hidden-xs menu"> | ||
<compodoc-menu mode="normal"></compodoc-menu> | ||
</div> | ||
<!-- START CONTENT --> | ||
<div class="content additional-page"> | ||
<div class="content-data"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h1 id="refreshing-a-token-using-code-flow-not-implicit-flow">Refreshing a Token using Code Flow (not Implicit Flow!)</h1> | ||
<p>When using code flow, you can get an <code>refresh_token</code>. While the original standard DOES NOT allow this for SPAs, the mentioned <a href="https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13">OAuth 2.0 Security Best Current Practice</a> document proposes to ease this limitation. However, it specifies a list of requirements one should take care about before using <code>refresh_tokens</code>. Please make sure you respect those requirements.</p> | ||
<p>Please also note, that you have to request the <code>offline_access</code> scope to get a refresh token.</p> | ||
<p>To refresh your token, just call the <code>refreshToken</code> method:</p> | ||
<div><pre class="line-numbers"><code class="language-typescript">this.oauthService.refreshToken();</code></pre></div><h2 id="automatically-refreshing-a-token-when-before-it-expires-code-flow-and-implicit-flow">Automatically refreshing a token when/ before it expires (Code Flow and Implicit Flow)</h2> | ||
<p>To automatically refresh a token when/ some time before it expires, just call the following method after configuring the <code>OAuthService</code>:</p> | ||
<div><pre class="line-numbers"><code class="language-TypeScript">this.oauthService.setupAutomaticSilentRefresh();</code></pre></div><p>By default, this event is fired after 75% of the token's life time is over. You can adjust this factor by setting the property <code>timeoutFactor</code> to a value between 0 and 1. For instance, 0.5 means, that the event is fired after half of the life time is over and 0.33 triggers the event after a third.</p> | ||
|
||
</div><div class="search-results"> | ||
<div class="has-results"> | ||
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1> | ||
<ul class="search-results-list"></ul> | ||
</div> | ||
<div class="no-results"> | ||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- END CONTENT --> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; | ||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'additional-page'; | ||
var COMPODOC_CURRENT_PAGE_URL = 'token-refresh.html'; | ||
var MAX_SEARCH_RESULTS = 15; | ||
</script> | ||
|
||
<script src="../js/libs/custom-elements.min.js"></script> | ||
<script src="../js/libs/lit-html.js"></script> | ||
|
||
<script type="module" src="../js/menu-wc.js" defer></script> | ||
<script nomodule src="../js/menu-wc_es5.js" defer></script> | ||
|
||
<script src="../js/libs/bootstrap-native.js"></script> | ||
|
||
<script src="../js/libs/es6-shim.min.js"></script> | ||
<script src="../js/libs/EventDispatcher.js"></script> | ||
<script src="../js/libs/promise.min.js"></script> | ||
<script src="../js/libs/zepto.min.js"></script> | ||
|
||
<script src="../js/compodoc.js"></script> | ||
|
||
<script src="../js/tabs.js"></script> | ||
<script src="../js/menu.js"></script> | ||
<script src="../js/libs/clipboard.min.js"></script> | ||
<script src="../js/libs/prism.js"></script> | ||
<script src="../js/sourceCode.js"></script> | ||
<script src="../js/search/search.js"></script> | ||
<script src="../js/search/lunr.min.js"></script> | ||
<script src="../js/search/search-lunr.js"></script> | ||
<script src="../js/search/search_index.js"></script> | ||
<script src="../js/lazy-load-graphs.js"></script> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
d95d7da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity has this been released? I see a new version 13.0.1 in npmjs, but the latest release here is 12, so it makes me wonder if that's official?
d95d7da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think NPMJS is leading @michaelfaith GitHub is more a bookkeeping thing. I guess a tag or such could be useful though. In any case, I recently successfully upgraded my sample to use v13 and it works well I suppose.
d95d7da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeroenheijmans good to know. But with all the exploits on npm recently, I like to do my due diligence. And with major version updates especially, I like to review the release notes for breaking changes. And the Changelog hasn't been updated for 13 either...