Skip to content

Commit 8e50ba6

Browse files
committed
updated readme
1 parent 1652e90 commit 8e50ba6

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

README.MD

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Username/Password: max/geheim
3131
## Resources
3232

3333
- Sources of this lib: https://github.com/manfredsteyer/angular-oauth2-oidc
34-
34+
- Sample Project: https://github.com/manfredsteyer/angular2-oauth-oidc-demo
3535

3636
## Setup Provider for OAuthService
3737

@@ -91,11 +91,11 @@ export class AppComponent {
9191
// instead of localStorage
9292
this.oauthService.setStorage(sessionStorage);
9393
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";
9696
9797
// Load Discovery Document and then try to login the user
98-
this.oauthService.loadDiscoveryDocument(url).then(() => {
98+
this.oauthService.loadDiscoveryDocument().then(() => {
9999
100100
// This method just tries to parse the token(s) within the url when
101101
// the auth-server redirects the user back to the web-app
@@ -128,9 +128,6 @@ export class AppComponent {
128128
// The SPA's id. Register SPA with this id at the auth-server
129129
this.oauthService.clientId = "spa-demo";
130130
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-
134131
// set the scope for the permissions the client should request
135132
this.oauthService.scope = "openid profile email voucher";
136133
@@ -145,21 +142,11 @@ export class AppComponent {
145142
// To also enable single-sign-out set the url for your auth-server's logout-endpoint here
146143
this.oauthService.logoutUrl = "https://steyer-identity-server.azurewebsites.net/identity/connect/endsession?id_token={{id_token}}";
147144
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({});
153149
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-
});
163150
164151
}
165152

0 commit comments

Comments
 (0)