# OKTA OpenID session expired even when user is active

**URL:** <https://devforum.okta.com/t/okta-openid-session-expired-even-when-user-is-active/18384>\
**Category:** OAuth/OIDC\
**Tags:** angular\
**Created:** [December 6, 2021, 4:49am UTC](https://devforum.okta.com/t/okta-openid-session-expired-even-when-user-is-active/18384 "2021-12-06T04:49:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sravan2478](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sravan2478](https://devforum.okta.com/u/sravan2478)\
**Post date:** [December 6, 2021, 4:49am UTC](https://devforum.okta.com/t/okta-openid-session-expired-even-when-user-is-active/18384/1 "2021-12-06T04:49:13Z")

</div>

Hi,

Am using OpenID authentication with Angular at front end and .net core at api end. Issue is even while am using the application the token is getting expired, why is OKTA not automatically refreshing token when the user is active? am getting the token from okta auth service everytime am making an API call, am I missing anything here? am using okta/okta-angular library, below is how I configured

oktaConfig: {  
issuer: ‘’,  
clientId: ‘’,  
redirectUri: ‘[http://localhost:4200/login/callback](http://localhost:4200/login/callback)’,  
postLogoutRedirectUri: ‘[http://localhost:4200](http://localhost:4200)’,  
scopes: [‘openid’, ‘profile’, ‘email’],  
pkce: true,  
tokenManager: { storage: ‘sessionStorage’}  
}

—app.module.ts—

providers: [  
{ provide: OKTA\_CONFIG, useValue: environment.oktaConfig }  
]

interceptor.ts----

constructor(private oktaAuth: OktaAuthService) { }

const accessToken = this.oktaAuth.getAccessToken();

---

<div class="post-metadata">

**Author:** ![sravan2478](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sravan2478](https://devforum.okta.com/u/sravan2478)\
**Post date:** [December 8, 2021, 11:02am UTC](https://devforum.okta.com/t/okta-openid-session-expired-even-when-user-is-active/18384/2 "2021-12-08T11:02:31Z")

</div>

Please let me know if am missing anything.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 9:05pm UTC](https://devforum.okta.com/t/okta-openid-session-expired-even-when-user-is-active/18384/3 "2024-02-12T21:05:12Z")

</div>

Closed on February 12, 2024, 9:05pm UTC


