Skip to content

Commit 3586052

Browse files
Merge branch 'master' into master
2 parents 2646f3a + b93e1ff commit 3586052

22 files changed

+4684
-13461
lines changed

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const authConfig: AuthConfig = {
116116
// URL of the SPA to redirect the user to after login
117117
redirectUri: window.location.origin + '/index.html',
118118

119-
// The SPA's id. The SPA is registerd with this id at the auth-server
119+
// The SPA's id. The SPA is registered with this id at the auth-server
120120
clientId: 'spa-demo',
121121

122122
// set the scope for the permissions the client should request
@@ -215,23 +215,7 @@ This directly redirects the user to the identity server if there are no valid to
215215

216216
### Calling a Web API with an Access Token
217217

218-
Pass this Header to the used method of the ``Http``-Service within an Instance of the class ``Headers``:
219-
220-
```TypeScript
221-
var headers = new Headers({
222-
"Authorization": "Bearer " + this.oauthService.getAccessToken()
223-
});
224-
```
225-
226-
If you are using the new ``HttpClient``, use the class ``HttpHeaders`` instead:
227-
228-
```TypeScript
229-
var headers = new HttpHeaders({
230-
"Authorization": "Bearer " + this.oauthService.getAccessToken()
231-
});
232-
```
233-
234-
Since 3.1 you can also automate this task by switching ``sendAccessToken`` on and by setting ``allowedUrls`` to an array with prefixes for the respective URLs. Use lower case for the prefixes.
218+
You can automate this task by switching ``sendAccessToken`` on and by setting ``allowedUrls`` to an array with prefixes for the respective URLs. Use lower case for the prefixes.
235219

236220
```TypeScript
237221
OAuthModule.forRoot({
@@ -242,6 +226,8 @@ OAuthModule.forRoot({
242226
})
243227
```
244228

229+
If you need more versatility, you can look in the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/working-with-httpinterceptors.html) how to setup a custom interceptor.
230+
245231
## Routing
246232

247233
If you use the ``PathLocationStrategy`` (which is on by default) and have a general catch-all-route (``path: '**'``) you should be fine. Otherwise look up the section ``Routing with the HashStrategy`` in the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/).

angular.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
@@ -21,14 +21,6 @@
2121
}
2222
}
2323
},
24-
"test": {
25-
"builder": "@angular-devkit/build-angular:karma",
26-
"options": {
27-
"main": "projects/lib/src/test.ts",
28-
"tsConfig": "projects/lib/tsconfig.spec.json",
29-
"karmaConfig": "projects/lib/karma.conf.js"
30-
}
31-
},
3224
"lint": {
3325
"builder": "@angular-devkit/build-angular:tslint",
3426
"options": {
@@ -114,7 +106,8 @@
114106
"tsConfig": "projects/sample/tsconfig.spec.json",
115107
"karmaConfig": "projects/sample/karma.conf.js",
116108
"styles": [
117-
"projects/sample/styles.css"
109+
"projects/sample/src/styles.css",
110+
"node_modules/bootstrap/dist/css/bootstrap.css"
118111
],
119112
"scripts": [],
120113
"assets": [

0 commit comments

Comments
 (0)