Open Closed

What is the replacement of abp.auth.getToken() in AspnetBoilerplate in new ABP? #177


0
jassada-mwp created

Hi I have a question about auth token in new ABP.

I have some 3rd party component in Angular that need to send auth token to backend service every time it post request. In old AspnetBoilerplate, I use abp.auth.getToken(). But I cannot find any api that can do the same in new ABP. Which api should I use for that in ABP?

Thanks


1 Answer(s)
  • 0
    liangshiwei created
    Support Team

    You can inject OAuthService to your services, it has getAccessToken method.

    Exampe : https://github.com/abpframework/abp/blob/d598024b77104caf2dd80ea39e1f07ff6fe9a1e5/npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts#L18.