Open Closed

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


User avatar
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


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    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.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I close this question, if you still have this question, please reopen.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11