Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify that the default interceptor does not handle a 401 or 403 status #1232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs-src/interceptors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Interceptors

Since 3.1 the library uses a default HttpInterceptor that takes care about transmitting the access_token to the resource server and about error handling for security related errors (HTTP status codes 401 and 403) received from the resource server. To put in on, just set ``sendAccessToken`` to ``true`` and set ``allowedUrls`` to an array with prefixes for the respective urls. Use lower case for the prefixes:
Since 3.1 the library uses HttpInterceptors. A default ``HttpInterceptor`` takes care about transmitting the ``access_token`` to the resource server (if configured, see example below). For handling security related errors (HTTP status codes 401 and 403), received from the resource server, applications should implement their own [custom interceptors](#custom-interceptors).

To enable the default ``HttpInterceptor``, just set ``sendAccessToken`` to ``true`` and set ``allowedUrls`` to an array with prefixes for the respective urls. Use lower case for the prefixes:

```TypeScript
OAuthModule.forRoot({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@


<h1 id="interceptors">Interceptors</h1>
<p>Since 3.1 the library uses a default HttpInterceptor that takes care about transmitting the access_token to the resource server and about error handling for security related errors (HTTP status codes 401 and 403) received from the resource server. To put in on, just set <code>sendAccessToken</code> to <code>true</code> and set <code>allowedUrls</code> to an array with prefixes for the respective urls. Use lower case for the prefixes:</p>
<p>Since 3.1 the library uses HttpInterceptors. A default <code>HttpInterceptor</code> takes care about transmitting the <code>access_token</code> to the resource server (if configured, see example below). For handling security related errors (HTTP status codes 401 and 403), received from the resource server, applications should implement their own <a href="#custom-interceptors">custom interceptors</a>. </p>
<p>To enable the default <code>HttpInterceptor</code>, just set <code>sendAccessToken</code> to <code>true</code> and set <code>allowedUrls</code> to an array with prefixes for the respective urls. Use lower case for the prefixes:</p>
<div><pre class="line-numbers"><code class="language-TypeScript">OAuthModule.forRoot({
resourceServer: {
allowedUrls: [&#39;http://www.angular.at/api&#39;],
Expand Down
4 changes: 2 additions & 2 deletions docs/js/search/search_index.js

Large diffs are not rendered by default.