@@ -31,7 +31,7 @@ Username/Password: max/geheim
31
31
## Resources
32
32
33
33
- Sources of this lib: https://github.com/manfredsteyer/angular-oauth2-oidc
34
-
34
+ - Sample Project: https://github.com/manfredsteyer/angular2-oauth-oidc-demo
35
35
36
36
## Setup Provider for OAuthService
37
37
@@ -91,11 +91,11 @@ export class AppComponent {
91
91
// instead of localStorage
92
92
this.oauthService.setStorage(sessionStorage);
93
93
94
- // Discovery Document of your AuthServer as defined by OIDC
95
- let url = ' https://steyer-identity-server.azurewebsites.net/identity/.well-known/openid-configuration' ;
94
+ // The name of the auth-server that has to be mentioned within the token
95
+ this.oauthService.issuer = " https://steyer-identity-server.azurewebsites.net/identity" ;
96
96
97
97
// Load Discovery Document and then try to login the user
98
- this.oauthService.loadDiscoveryDocument(url ).then(() => {
98
+ this.oauthService.loadDiscoveryDocument().then(() => {
99
99
100
100
// This method just tries to parse the token(s) within the url when
101
101
// the auth-server redirects the user back to the web-app
@@ -128,9 +128,6 @@ export class AppComponent {
128
128
// The SPA's id. Register SPA with this id at the auth-server
129
129
this.oauthService.clientId = "spa-demo";
130
130
131
- // The name of the auth-server that has to be mentioned within the token
132
- this.oauthService.issuer = "https://steyer-identity-server.azurewebsites.net/identity";
133
-
134
131
// set the scope for the permissions the client should request
135
132
this.oauthService.scope = "openid profile email voucher";
136
133
@@ -145,21 +142,11 @@ export class AppComponent {
145
142
// To also enable single-sign-out set the url for your auth-server's logout-endpoint here
146
143
this.oauthService.logoutUrl = "https://steyer-identity-server.azurewebsites.net/identity/connect/endsession?id_token={{id_token}}";
147
144
148
- // Discovery Document of your AuthServer as defined by OIDC
149
- // You don't need to set this, when the url aligns with the oidc standard
150
- // (IssuerUrl + '/.well-known/openid-configuration')
151
- // let url = 'https://steyer-identity-server.azurewebsites.net/identity/.well-known/openid-configuration';
152
- // this.oauthService.loadDiscoveryDocument(url);
145
+ // This method just tries to parse the token(s) within the url when
146
+ // the auth-server redirects the user back to the web-app
147
+ // It dosn't send the user the the login page
148
+ this.oauthService.tryLogin({});
153
149
154
- // Load Discovery Document and then try to login the user
155
- this.oauthService.loadDiscoveryDocument().then(() => {
156
-
157
- // This method just tries to parse the token(s) within the url when
158
- // the auth-server redirects the user back to the web-app
159
- // It dosn't send the user the the login page
160
- this.oauthService.tryLogin({});
161
-
162
- });
163
150
164
151
}
165
152
0 commit comments