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

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.