File tree 3 files changed +6
-2
lines changed
3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import { AuthService } from './core/auth.service';
33
33
<tr><th>IsDoneLoading</th><td><code>{{isDoneLoading | async}}</code></td></tr>
34
34
<tr><th>CanActivateProtectedRoutes</th><td><code>{{canActivateProtectedRoutes | async}}</code></td></tr>
35
35
<tr><th>IdentityClaims</th><td class="pre"><code>{{identityClaims | json}}</code></td></tr>
36
+ <tr><th>RefreshToken</th><td><code class="break-all">{{refreshToken}}</code></td></tr>
36
37
<tr><th>AccessToken</th><td><code class="break-all">{{accessToken}}</code></td></tr>
37
38
<tr><th>IdToken</th><td><code class="break-all">{{idToken}}</code></td></tr>
38
39
</table>
@@ -66,6 +67,7 @@ export class AppComponent {
66
67
67
68
get hasValidToken ( ) { return this . authService . hasValidToken ( ) ; }
68
69
get accessToken ( ) { return this . authService . accessToken ; }
70
+ get refreshToken ( ) { return this . authService . refreshToken ; }
69
71
get identityClaims ( ) { return this . authService . identityClaims ; }
70
72
get idToken ( ) { return this . authService . idToken ; }
71
73
}
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { AuthConfig } from 'angular-oauth2-oidc';
2
2
3
3
export const authConfig : AuthConfig = {
4
4
issuer : 'https://demo.identityserver.io' ,
5
- clientId : 'implicit' ,
5
+ clientId : 'spa' , // The "Auth Code + PKCE" client
6
+ responseType : 'code' ,
6
7
redirectUri : window . location . origin + '/index.html' ,
7
8
silentRefreshRedirectUri : window . location . origin + '/silent-refresh.html' ,
8
- scope : 'openid profile email api' ,
9
+ scope : 'openid profile email offline_access api' ,
9
10
silentRefreshTimeout : 5000 , // For faster testing
10
11
timeoutFactor : 0.25 , // For faster testing
11
12
sessionChecksEnabled : true ,
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ export class AuthService {
168
168
// These normally won't be exposed from a service like this, but
169
169
// for debugging it makes sense.
170
170
public get accessToken ( ) { return this . oauthService . getAccessToken ( ) ; }
171
+ public get refreshToken ( ) { return this . oauthService . getRefreshToken ( ) ; }
171
172
public get identityClaims ( ) { return this . oauthService . getIdentityClaims ( ) ; }
172
173
public get idToken ( ) { return this . oauthService . getIdToken ( ) ; }
173
174
public get logoutUrl ( ) { return this . oauthService . logoutUrl ; }
You can’t perform that action at this time.
0 commit comments